This is a migrated thread and some comments may be shown as answers.

Confirm node expand when use HierarchyLoadMode="ServerOnDemand"

3 Answers 146 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tiffany
Top achievements
Rank 1
Tiffany asked on 30 Mar 2012, 08:30 PM
I am working on web page which has a radgrid similar to the one displayed on this page.  http://demos.telerik.com/aspnet-ajax/grid/examples/programming/detailtabledatabind/defaultcs.aspx

The grid datasources are business objects which are popupated from DB2 tables.

The business requirements are: 

In the Order Detail grid, the Quantity is displayed in a text box.  I am using

RadNumericTextBox in a GridTemplateColumn.

The user can update the Quantity on the Order Detail grid and click the Save button to save the Order Detail.  This Save button is displayed in the Order Detail NestedViewTemplate.

The user can update one Order Detail at a time which mean when he/she expands other Order node, the web page needs to display an alert or confirm to prompt the user to save the updated Quantity before expanding the next Order detail.

 

 

 


When the user expands the Customer Order node, I am retrieving and setting the datasource of the Order Detail grid in the RadGrid1_ItemCommand event handler.  Could someone please tell me is there a way to display an alert or confirm to prompt the user to save the updated Quantity before expanding the next Order detail?  Why does OnHierarchyExpanding client event requires HierarchyLoadMode="Client"?  I am not allowed to use databinding on the client side.

Thanks for your help!

 

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 04 Apr 2012, 03:02 PM
Hello Tiffany,

As noticed in the online help article for HierarchyExpanded client-side event: This event is fired when the hierarchy has been expanded and the HierarchyLoadMode setting is set to Client.

All the best,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Tiffany
Top achievements
Rank 1
answered on 04 Apr 2012, 04:22 PM
Hi Pavlina,
I need to handle the expand/collapse command similar to the topic listed on this website http://www.telerik.com/community/forums/aspnet/grid/pop-up-messagebox-when-expanding-radgrid.aspx and by the requirements, I must use HierarchyLoadMode = "ServerOnDemand".  I have attached a sample screenshot.  In this example, when the user expands order 10643, I will retrieve the Order detail in the OrderSummaryRadGrid_ItemCommand event handler.  The user then updates the Quantity amount.  If the user expands other Order summary, for example, Order 10952 without clicking the Save button on the detail section of order 10643, a confirmation box will be displayed to prompt the user for saving the changes.  And when the user selects "Cancel" from the confirmation box, the detail order 10952 will be displayed and the detail order 10643 will be collapsed. When the user selects "Yes" from the confirmation box, the page will call a server method to save the Order detail.  How can I achieve this functionality with the HierarchyLoadMode = "ServerOnDemand" option?

Thanks for your help!
0
Pavlina
Telerik team
answered on 09 Apr 2012, 04:42 PM
Hi Tiffany,

After you want HierarchyLoadMode to be ServerOnDemand, you should handle OnGridCreated server-side event, access the expand/collapse image of grid ExpandColumn and attach to it the desired javascript confirmation. This way you should be able to achieve your goal.

Regards,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Tiffany
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Tiffany
Top achievements
Rank 1
Share this question
or