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

dragging items from RadTreeview and Placing in Radgid Group Panel

1 Answer 46 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Radhika
Top achievements
Rank 1
Radhika asked on 24 Oct 2011, 02:23 PM
Hi ,

I need to drag an item from RadTreeView and place it in the group Panel of a radgrid in RadTreeView1_NodeDrop event  and grouping should be done accordingly . I am binding the Columns dynamically to the radgrid not in design time . Could you please send me a sample for this?

My requirement is same as : http://www.telerik.com/community/forums/aspnet-ajax/ajax/drag-columns-to-grid-group-panel-and-grid-separetly.aspx


Regards
Radhika

1 Answer, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 27 Oct 2011, 10:24 AM
Hi Radhika,

 
In order to achieve this you will need to handle the OnClientNodeDropping client side event of the RadTreeView, detect that the node has been dropped on the Grid group header and fire the corresponding group command. For this you should have the corresponding column already shown in the grid.
You can handle the OnClientNodeDropping event as shown in this help topic:
http://www.telerik.com/help/aspnet-ajax/treeview-onclientnodedropping.html
To detect that the node has been dropped on the grid group header you should check that the ID of the destination element contains the <RadGridName>_GroupPanel string.
Firing the group command from the client can be done as shown here:
http://www.telerik.com/help/aspnet-ajax/grid-gridtableview-firecommand.html
you should pass the name of the column that you need to group on.
You can use the below code snippet as a starting point:

function ClientNodeDropping(sender, eventArgs)
 {
        if (eventArgs.get_htmlElement().id == "RadGrid1_GroupPanel")
        {
              grid.fireCommand("GroupByColumn", "ColumnUniqueName");
        }
 }

All the best,
Marin
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
Radhika
Top achievements
Rank 1
Answers by
Marin
Telerik team
Share this question
or