Hi,
We recently added row group functionality to our grids and we and our users are very happy with it.
In the grids in our applications grouping on some types of column is not allowed. It is not visible for the user by the hover style of the grouping panel grouping on the dragged column is not allowed until the column is dropped and the postback to the web-server is happened.
In my case columns are resizable and reorderable also.
It should be nice to disallow these column from been dropped and by adding style to the mouse cursor and/or the drop indicator of the grouppanel when GridTemplateColumn.Groupable=false.
4 Answers, 1 is accepted
Actually if the Groupable property is set to false you should not be allowed to group the column and a dragg-able element should not be created. Could you please send us a video illustrating the problem? Additionally if you can share with us one of the grids code with which this behavior can be observed that would be great.
Regards,
Angel Petrov
Telerik
Hi Angel,
In this case columns are dragg-able because column reording is allowed to put columns in a different order in the grid itself.
My code is to complex to provide a snippet of it. This is how I use the RadGrid from the code behind:
RadGrid gridview = new RadGrid();
// Enable column reorder
gridview.ClientSettings.AllowColumnsReorder = true;
gridview.ClientSettings.ReorderColumnsOnClient = false;
gridview.ClientSettings.ColumnsReorderMethod = GridClientSettings.GridColumnsReorderMethod.Reorder;
// Enable grouping
gridview.GroupingEnabled = true;
gridview.ShowGroupPanel = true;
gridview.GroupingSettings.ShowUnGroupButton = true;
gridview.ClientSettings.AllowDragToGroup = true;
gridview.ClientSettings.AllowGroupExpandCollapse = true;
// Add columns
gridview.Columns.Add(new GridTemplateColumn({ HeaderText = "Groupable1", Resizable = true, Reorderable = true, Groupable = true });
gridview.Columns.Add(new GridTemplateColumn({ HeaderText = "Not Groupable", Resizable = true, Reorderable = true, Groupable = false });
gridview.Columns.Add(new GridTemplateColumn({ HeaderText = "Groupable2", Resizable = true, Reorderable = true, Groupable = true });
// TODO Bind data...
Now drag the "Not Groupable" column on the grouppanel. The grouppanel will give you the idea that the grid will group on it when dropping it, but it is not. As a user I would like to see the cursor style changing to "no-drop" and the drop indicator not been shown.
I hope this helps you to understand my issue.
Your observations are correct currently there is no visual indication that grouping will not be performed when the drop occurs. Please log a feature request regarding this requirement in our feedback portal so we could evaluate it and expose such functionality in the upcoming releases.
Regards,
Angel Petrov
Telerik