Asp net gridview rowupdating not firing dating love ua

Using Template fields with Command Argument and Command Name also fires the fires the same Row Command event on the Data Grid.But the handling of the Grid View Command Argument is quite different.So I'm taking a few minutes - for my own sake - to write this stuff down so I can look it up next time I have a brain fart Using a Button Field you can specify a Command Name which in turn provides the On Row Command event some context as to what type of operation you are dealing with in Code Behind.In Code Behind you have to do a bit of work though if you want to retrieve the proper context from a Data Item.From there I can then retrieve the Data Row based on the index.

Presumably you should should use one or the other but not both together to avoid confusion.For clarity I've explicitly broken out each of the objects here: As you can see getting the PK is now easy - it's simply available as the Command Argument and so it's easy to get context to the underlying data.However, if you need to get at the actual live data item the work requires first to get the control that fired the event (Link Button), walking up to its naming container (Grid View Row) and then getting the Data Item Index.Although the Grid View Command Event Args have a Data Item member that member is unfortunately not set with the Data Row as you would maybe expect.So rather than getting the bound item directly, I have to retrieve the grid Row's Data Item index, then use that index and retrieve the value from the original data source.

Search for asp net gridview rowupdating not firing:

asp net gridview rowupdating not firing-18asp net gridview rowupdating not firing-58asp net gridview rowupdating not firing-11asp net gridview rowupdating not firing-18

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “asp net gridview rowupdating not firing”