Gridview1 rowupdating old values

Posted by / 15-Mar-2015 12:50

Gridview1 rowupdating old values

If you go with the flow, you probably won't get stuck, but the moment you try to go against the grain you end up with a hand full of thorns.Most of the data controls have events ending in ing and ed e.g. In most of the event handlers of the ing events it is easy to get the values from the event args.So I decided to instead put the code in an assembly and make available for download here. the good old problem of getting the data from the row that is being currently edited within a Grid View. Accessing the "Controls": This method gets you access to the control in the Grid View, which might be useful based on what you are doing.

I often see people on the forums writing code like this: Find Control is a very powerful method on Control that allows you to search for a nested control, NOT synonymous to DOM function get Element By Id.Obviously the simplest method is to use Data Key Names on the Grid View and then you should have the data in your Grid View Update Event Args as part of e. (In the following example, I cast to a Check Box as I know I have a checkbox at the col Index You Are Interested In - you should cast to whatever control you have in that column). As the values are inserted into an Ordered Dictionary - you can use the field names to access the changed data 2.If you can, use 2 way databinding, if your control doesn't have a useful property to bind against and you need to do some more logic to get the right value then use Find Control.Edit: I've updated the code to loop over the Cells collection instead of the Controls collection (which is alot cleaner).

gridview1 rowupdating old values-26gridview1 rowupdating old values-27gridview1 rowupdating old values-53

2-way Data Binding2-way Databinding is a cool feature in ASP.

One thought on “gridview1 rowupdating old values”