Gridview rowupdating asp net 3 5
AARP_DATA_D1_Bill Matri It still gets the old values, when I loop thru the Dictionary and in debug step thru it I see it still gets the original values not the new values that the user enters when they are changing each item.
// Iterate through the New Values collection and HTML encode all // user-provided values before updating the data source. New Values) guru_sami, sorry it took me so long to get back, I have been off on vacation and just got back, but yes you are right on, I went back and debugged the entire postback and it was rebinding the grid on postback on the page_load event. Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros.
But what happens is that I do get some of the values but they are the original values not the new ones being changed.
So the problem I am having is that when I get the Datakey value I am trying to get the values in the controls in the Edit Mode of the current row I am trying to update. I am using the Find Control function to get the values from the editing row so I specifically name the dropdownlists and textboxes so I can access them here.
We can implement it in this way without a performance impact because the data is not actually retrieved from the database until required, so we can build up a chain of queries up to that point and only the end result will be pulled from the database. When manually databinding the Grid View, this will always show ascending, so we need to handle this manually with the following logic: After that we save the new Sort Expression.
We’re sorting on the appropriate field based on the Sort Expression, and setting the direction based on Sort Direction by calling either the Order By or Order By Descending methods. As with paging, we also reset the Edit Index and Selected Index when sorting.
For the Bound Field, we don’t know the ID of the Text Box since it’s autogenerated by the Bound Field, so we obtain a reference to it by getting the first control in the appropriate cell in the edited row.
Since it’s a Bound Field, the Text Box is going to be Control.
We’ll revisit this method when we implement the sorting functionality.