Rowupdating event grid view

The simplest solutions for this error is : Just change the “Command Name” property of the “Edit” button from “Edit” to “Edit Row”(or something else which is relevent to you but make sure it is not “Edit”). After scratching my head for sometime I found that the words like “Edit” are reserved to invoke some built in functionality of the Grid View.So when we use these special key words as the Command Name for the buttons in the Grid View, they automatically invoke the built in functionality of the Grid View when we click on the button.As our code does not handle those events hence they throw an exception.So when we change the Command Name property of the buttons to some other text then it will work fine.Some other Grid Views reserved key words and their default associated events are as follow : “Cancel” – Raises the Row Canceling Edit event.“Delete” – Raises the Row Deleting and Row Deleted events. “Page” – Raises the Page Index Changing and Page Index Changed events.

The button is associated with the Command Name property as “Edit”.The Grid View is associated with the On Row Command event.Then in the code behind I have handled the On Row Command event.In the event handler function I have checked for the Command Name property and write necessary code for each of the actions.The HTML code for the Grid View is as follow : The event handling code for the Row Command event is as follow: protected void gd Test_Row Command(object source, Grid View Command Event Args e) { if (e. Trim() == "Edit") { //Code for the editing } } Till now everything looks fine but the problem arises when you run this application.

Search for rowupdating event grid view:

rowupdating event grid view-12rowupdating event grid view-39rowupdating event grid view-36

Leave a Reply

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

One thought on “rowupdating event grid view”