Hi there,
I created a control that inherits from RadGrid to include a RadWindow editing feature, similar to the sample here http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=grid
The main difference is that I do not want to use an external page, as in the sample above, but I want to use a template to be dynamically loaded in the RadWindow. Also, I'd like to handle all load & save events using the RadGrid ItemCommand.
So I created an ITemplate EditWindowTemplate property in my control and I instantiate it in the RadWindow contentcontainer when needed.
This is the code I use to extend the RadGrid js client
So, when the user click the "Add new" link or an Edit link, I start a partial postback that loads the RadWindow contents, using an UpdatePanel.
This is the UpdatePanel PreRender method I use to display the UI and pass the edit item index to the server
If the user clicks on the Add link, I fire the InitInsert event, if he clicks an Edit link I fire the Edit event.
Last, I handle the ItemCommand event in a page to respond to each event: Edit (load an item and show the edit form), InitInsert (show empty edit form), Update (the user saved a change) and PerformInsert (the user saved a new item).
When I create a new item everything works, but when I try to save a change to an existing item I get
Specified argument was out of the range of valid values.
Parameter name: ItemHierarchicalIndex
What am I doing wrong?
Thanks!