I have a Gridview and two link button in that GridView , one link button click is to add edit row ( Edit ), one link button click is to select row ( Select ). I have a dropdownlist inside row which selected when i click link button Select in the gridview edit template, as of my business logic i need to show the dropdownlist only when the user clicks Edit button and when the user clicks Select button . That mean when the user clicks Select button then they clicks Edit button on the gridvview i should allow him to edit the dropdownlist (showing the value to the user through a label).
When I click Select link button , then I click Edit link button . They have errors : Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index" I don't know what error?. How to fix it
I need your help / guidence for doing custom paging in c#, through sqlserver. so that i can have data in dataset/datatable according to the pagesize given, not all the data in dataset. some code /url .......with full discrption if possible.
I am new to asp.net and was trying to use datagridview in my webform. I was able to bind it to my database but I cannot make the datagridview's buttonfield respond. It seems the grid's SelectedIndexChanged event is not being fired or has issues with postback. Even a very simple statement is not being executed by the program e.g.
Codebehind: creating dataset, getting data from sql with adaptor and filling into dataset object, then setting detailsview's datasource. I add 2 button to above template to able to edit data at asp page, and added event handlers:buttons:
My question is, what to do inside the detailsview update event function to able to edit and update data. My method can be wrong too.
Return myDataReader I have a function which is retuning a datareader to various sections of my website which is then being bound to dropdown lists, gridviews, etc. Normally the last line in a function when is the data reader and connection getting closed? Is it best practive to return a data reader or a dataset/datatable (or something even better than these two)?
I have two SQL queries that are stored procedures that have 2 variables that my web form will be supplying through text boxes. The two queries will produce two different results. I have read a couple of different of the MSDN articles online, including this one:
that say that the tables must be similar to be able to merge them into a single datagridview. I know that datagridviews only like one table at a time, but I was curious if anyone had found a way to merge two dissimilar tables to one datagridview or not.
i have a table called product which contain fields of product_code and product_name....now i want to show product name in gridview field whenever i write product_code in a column.....when i write product code in gridview column then product name will be generated automatically in gridview column...how can i do this
Trying to update a .NET .20 datagridview in the following scenario. A page contains a formview. The formview contains a datagridview and some other fields not in the grid. The formview has its own ObjectDataSource and the datagridview has a separate ObjectDataSource. Each ObjectDataSource has an OnUpdating event. Clicking a Save button triggers the formview update event and the "non-grid" ObjectDataSource updates without a problem. In that same event, I also want to update the grid's ObjectDataSource. Because it's a grid, this OnUpdating event has to loop through each row, get the data for that row and set the UpdateParameter values. A foreach loop can get the values, but how do I trigger the update before looping to the next row?
Should I try calling a different kind of event for the DataGridView's ObjectDataSource? Or is there a way to get all the grid's new data at once as a dataset or datatable and do one bulk update? The datagridview does not have row-level edit/update buttons. It is meant to be an all-or-nothing kind of update.