I am sharing this because I see a lot of questions on the forums on how to get the value from the Grid View object, and I know how.As a beginner it's very tough and challenging to work with controls like a Grid View in ASP. Even I faced difficulties at the starting point of my career. Here, I am not going to explain about Grid View and other events in it, because there are a lot of good articles about that. Here's my entire code for this page, minus the actual sql Statement. Naming Container as Grid View Row; now use this row.To avoid this we need to keep the property Read Only as false, Then in the edit mode nothing will happenes. The reason I use Template Field instead of Bound Field is that, it is very easy to grab those controls in the codebehind if we user labels or textboxes.
So Grid View will put the appropriate row into the Edit Mode by assigning row number to its Edit Index property. You can follow any responses to this entry through the RSS 2.0 feed.
Robert, your example didn't error, now I just need to figure out how to bind it to the datasource. Now that the checkboxlist is there I need it bound to the database behind the gridview, and on submit, write approve or deny to the database for the rows that have selections made. is that your submit button is per row or single in page ?
If it's better to do it without the dataset, then that's fine, I just need to get these checkboxes updating the correct field in the database on a row by row basis somehow, and I'm not near good enough with C# to do that.
We will use Template Field, whenever we want to define some custom control in the data bound controls like Grid View, Data Grid or Data Repeater.
If he clicks edit (or) in the edit mode he can be able to see the Textbox.