Editing the Grid View control can be an incredibly easy feature to add for certain database tables, especially those who have no foreign key associated and can easily be edited through the use of a standard Text Box web control as shown in the figure below: 1.You need to include the Grid View Command Field column to add Edit, Update and Cancel Buttons in the Grid View. You need to include Template Field for every column you want to provide Editing because Template Field provides you both Item Template and Edit Item Template to create interface for two separate Grid View modes. You need to handle Grid View events such as Row Editing, Row Canceling Edit and Row Updating to provide desired editing functionality.Also, if using Template Fields for your columns, you must have an Edit Item [email protected] With the Find Control code posted above. BTW, @Yet is correct...using Data Keys for anything other than primary keys is a hack, and you don't seem to need it in your situation.you try to retrieve value from textboxes (Row Updating) & use the updated value to make changes in your data source. BTW, your statement directly above is attempting to force a string (.
If you are populating the gridview manually, you will have to handle the event.
Now I will show you the C# code behind file of the above ASP.
I was just testing if I will get the changed value out of the textbox when updating with no luck.
A common way to use these collections is to HTML-encode the values supplied by the user before they are stored in the data source.
The visitors to a web site can typically be divided into two groups: the users and the administrators.
So here is my problem: I can access one column through Data Key Names property in my GView tag, but I have to access other elements in order to UPDATE my Grid View through LINQ in the code behind.