|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
RowCommand Event of a nested GridviewHow do I handle the RowCommand event for a nested gridview? I want to be able
to detect which command (edit or delete) for the child gridview and the row that raised the event. I don't have problems with the parent gridview. I assume you are having a problem with the Design Mode to get at the
Events listing in the Properties window. That is a problem. In this case what I do is handle the RowDataBound event. In there I can get to the Cell holding the embedded controls and set values on them. In your case, you want to reach into it and attach an event handler. You need to do it programatically since you cannot do it with the designer. Then you want to set the CommandName and CommandArgument values of your button controls so that when the RowCommand event is raised you can check those values to determine what to do. Using an embedded GridView within a GridView entails many caveats. You are going to have to be careful. And be sure to run through it a bit with the debugger to understand what is actually doing. What you expect it would do can often be something very different than what is actually doing. That has bitten me plenty as I have worked with ASP.NET. Brennan Stehling http://brennan.offwhite.net/blog/ NEO wrote: Show quoteHide quote > How do I handle the RowCommand event for a nested gridview? I want to be able > to detect which command (edit or delete) for the child gridview and the row > that raised the event. I don't have problems with the parent gridview.
Confirm Message in gridview
Can't repopulate DropdownList control during postback? NullReferenceException with dynamic DataGrid Custom Control at deisgn time Tree view with XML and Populateondemand Slow File Upload Speed IIS 6.0 ASP.net 2.0 User controls and LoadControl method Newbie ASP.NET question for Webportal project How to use .Net controls in regular ASP XPath Asp.net |
|||||||||||||||||||||||