Gridview rowupdating get new value

Hi there, I have the same problem and I checked the e.

New Values,this is equal to Nothing, I Bind it to List object.

The problem I have is that when I click on 'Edit', then change some values then click 'Update', I can only get the old values.

All of the other posts I have read have mentioned the Grid View being bound on post back or within a Row Data Bound event but I'm pretty sure that I am not doing that.

Find Control("txtdescription") Dim txtunit_price As Text Box = gvr. Edit Index = -1 'Bind data to the Grid View control. When all you've got is a Hammer, Every Problem looks like a Nail. Since you are already getting a Row Updating event, I'll work from there.

Find Control("txtqty") Dim txtdescription As Text Box = gvr. However, your problem may have more to do with the fact that you Data Bind the Grid View in Row Updating. This can be beneficial to other community members reading the thread.

Delete Booking(Booking) End If Bind Grid View Trainer(Selected Date.

gridview rowupdating get new value-90gridview rowupdating get new value-41gridview rowupdating get new value-29

Edit Index = -1 Bind Grid View Trainer(Selected Date. Text) End Sub Protected Sub Grid View Trainer_Row Editing(By Val sender As Object, By Val e As Grid View Edit Event Args) Grid View Trainer. New Edit Index Bind Grid View Trainer(Selected Date.To get both the old and the new value of a field named unit_price, (for the example as a String.Unless they are Key fields, there isn't really a way to get to these. Data Bind in Row Updating (or at least before the Update is actualy processed) is better not done. Grid View (and some others) won't play nice when doing that. If it is a Data Control Field Cell, cast to that and get its Containing Field. Update Command = "usp_update PTTroot String" ' Call stored procedure Dim rows Affected As Integer = 0 Try rows Affected = item Data Source. Containing Field, Bound Field) Dim values As New Ordered Dictionary() field1Field. You will then have a Dictionary with all values in it. And no cast will be needed, as Containing Field already is of that type. When all you've got is a Hammer, Every Problem looks like a Nail. Okay, I am sorry that I am jumping around trying to work this out. I am not sure which direction you are suggesting I go here. New Values("brief_Descrip")) = "" Then update Description = "" Else update Description = e. To String() End If Dim update Key As Integer = row. Text If update Description = "" Or update Description = "Null" Then update Description = "Null" End If I am guessing you are Data Binding in code-behind. (Or possibly one that implements IData Source.) If so, examine the Row (use Find Control if possible) to get the Controls holding the edited values from the Cells. However, you can also examine the Cells of the Row. Cells(6), Data Control Field Cell) Dim field1Field As Bound Field = Direct Cast(field1Cell. If you use Template Fields, you should go for the Extract Values method, and extract the values from each Cell. This can be beneficial to other community members reading the thread.

Leave a Reply