I'm using a DataSet to fill my gridview. The dataset contains several columns, like: direction - fromNumber - toNumberThe column direction can contain the values "incoming" or "outgoing". In my gridview, I would like to show only 2 columns, direction and from/to. If direction = "incoming", the values from fromNumber has to be inserted in "from/to". If direction = "outgoing", the values from toNumber has to be inserted in "from/to".I know I can use a TemplateField to show different text values in a column...But I have no idea how to do this when I want to show the values from a column...
Below is the code behind for a simple aspx page. The web form contains one GridView (GridView1) and one label (Label1). I create a Data Table, then add a row to the table. I then DataBind my GridView to the DataTable. (so far so good) When I run the page I do see the GridView and the single row of data. However the checkbox shown is not enabled, meaning the user cannot uncheck or check it. (As if was not enabled)
Imports System.Data.SqlClient Imports System.Data PartialClass test Inherits System.Web.UI.Page ProtectedSub Page_Load(ByVal senderAsObject,ByVal eAs System.EventArgs)HandlesMe.Load CreateDT() EndSub PrivateSub CreateDT() Dim dtAsNew DataTable Dim col1AsNew DataColumn [code]...
i build some shopping cart. I have Datalist that display products from SQL table (id, productName, productPrice) and "Add" button. After the user click the button the product appear in the GridView (im using Session DataTable) until now all fine and work greate! in every product i need to add 2 checkboxlist from SQL tables (its some extra to the product). How can i get the items the user was checked and put them with the product name in the same datatable coloumn? the aspx code:
customer_id items 123 pen 123 paper 456 pen 456 paper 678 pen
then i pivot the gridview by using the datatable.. i call the sql query to the datatable, pivot it using pivoted function and the datatable then become the datasource bind to the gridview..the result of pivoted datatable in gridview as below:
my question is..how can i replace the empty column with textbox to be display within the gridview??? i need to use textbox so that user may enter the value of the item within the textbox.. i try using the itemtemplate for gridview but it's doesn't work and the itemtemplate create new column with textbox beside the paper column.. how to input textbox within the datatable in my case??
Among the many aspects of asp.net that I haven't focused my development on yet is caching. I have a perfect application for it now, I think, with a GridView that sits inside a repeater, and is bound in the Repeater ItemDataBound event. The contents of the GridView will remain static for each Repeater data item for each Client. The nature of the data in the GridView is that it can change from day to day per Client, but wouldn't need to be refreshed more frequently than that. The Page istelf only deals with one at a time Client based on a QueryStringParameter. My questions are a) how do I cache the DataTable so that a call to the DataBase isn't made each time Repeater item is bound and b) can I create/cache multiple DataTables (one for each Client) and let them live for day, checking for existence before calling the SQL stored procedure to regenerate the data?
Is there any way that I could work around it rather than actually going back to change the excel files ? Because I have like 1,000 excel files in that kinda format and seriously giving me headache now.
I have a details view on my page that has a template field in it. In the template field is a button that when clicked, sets the visible property of another field to true. When this happens the whole detailsview resets and anything that was entered into other fiields is cleared. Is there any way to prevent the other fields from being cleared when the hidden field is set to be shown.
I'm having major performance issues with my BBCode/Commenting system. It's taking 3 seconds to process the code, with 5 comments and a simple [b] command.
So here's what I am doing (it's done like this because of the way my backend system is designed):
"LoadComments" function is called with referenced to the repeater. "PagingSystem" is initializedBind data to controlData is pulled from the binded control (if bbcode is enabled) Data is put into a dataview Process text and convert BBcode (update row) BindData I disabled every feature, including the BBCode, and it's still loading slow. This is the ONLY thing I can think of causing the issue. Here is the base code that process bb:
As you can see, it uses my own data management code. Even without using it, I'm still not 100% sure how to modify the contents inside of a repeater. I don't see how modifying them could slow it down so bad..