"test" will appear in label not "asd" as I would want to.
First, I load up some data: After that, I’m doing some work to make my Grid View look beautifull, adding all columns by hand.
But for this demo, I’ll show you the simple version, that also doesn’t work 🙂Let’s bind the data to our Grid View and have it autogenerate our columns, as well as an edit button.
If you reset the Data Source at this stage, your values for updating will be lost. I actually don't know how to write the Row Updating function, I just found it from the internet, and so of course it's not working. Please give some references and/or details of how to. Ok what's happening is that you are binding the data source for the Grid View every time a postback occurs in the Page_Load method.
Count ----------- The most common problem for losing new data entered while updating a Grid View or Data Grid is that you are resetting the Data Source for the Grid View or Data Grid in the Page_Load method. I actually don't know how to write the Row Updating function, I just found it from the internet, and so of course it's not working.
All samples of course assume you’re doing everything in your page, but I have to do everything in my code-behind, because on forehand I don’t know what I’ll be binding to my Grid View.
Check out what I’m trying to do, maybe you can help?Please help me with writing a Row Updating function in C#, I don't know how to grab the current field's value and also get the old value for one of keys (which is Project Name for editing) of the selected row. the idea wa to don't allow binding the grid view after a post back. hello my problem was that my gridview editable controls heep their old values. this is due to the grid view binding in the page_load method after every post back. The index of the row to which the clicked cell belongs.When you have several pages in a grid, grid rows are indexed beginning with 0 on each page.If you don't use one of the Data Source controls, you are required to handle the Row Updating event.