My RadGrid uses a user control for its editing, and because that user control is also used outside of a RadGrid (in a FormView), I'm running into a problem. I could resolve it if I could locate (using FindControl?) the user control inside the RadGrid.
- Both the RadGrid and the FormView / ObjectDataSource call a method for the update, and that business object expects an object whose properties match the fields in the database.
- The user control contains a LinkButton to fire the update process.
If I was using only the RadGrid, I'd add code to the ItemCommand event, determine that it was the update event firing (because the CommandName of the LinkButton would be "Update"), find my user control by calling e.Item.FindControl(GridEditFormItem.EditFormUserControlID), and I'd be on my way.
If I was only using the FormView, I'd change the CommandName of the LinkButton to something OTHER THAN Update (so I could avoid the object data source from trying to do the update), respond to the command in the FormView's ItemCommand event, and find my user control by calling myFormView.FindControl(<the user control's ID>).
Here's the problem:
To keep the object data source from trying to do the update, I have to set the CommandName of the LinkButton to something other than "Update". If I set the CommandName of the LinkButton to something other than "Update", I don't get a GridEditFormItem in the RadGrid's ItemCommand event, I get a GridDataItem - and no way to get to the user control.
How do I locate the user control used by a RadGrid?
Thanks,
Ben
(please respond to ben.furino@bolderimage.com)