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

Unable to disable GROUPING

2 Answers 121 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pei Chen
Top achievements
Rank 1
Pei Chen asked on 03 May 2010, 08:29 PM

Hi,

I want to disable "grouping" function.  For some reason, I keep getting it no matter I set GroupingEnabled="False" on grid,
adding Groupable="false" to columns and AllowDragToGroup="false" in clientSettings.  It allows me to drag the header and then will return a javascript error "'this.get_element()' is null or not an object".  Please help how to set GROUPING off.  thanks!!

  <telerik:RadGrid  ID="RadGrid1" runat="server" AllowMultiRowSelection="True"  GroupingEnabled="False" 
                AllowSorting="True" AutoGenerateColumns="False"    
                Skin="Black"  SelectedItemStyle-ForeColor="Aqua"   
                OnSortCommand="RadGrid1_SortCommand" ShowGroupPanel="False">  
             <MasterTableView ClientDataKeyNames="AlarmGUID"  RowIndicatorColumn-Display="false" TableLayout="auto"  AllowMultiColumnSorting="true" > 
             <Columns> 
                    <telerik:GridBoundColumn DataField="Severity"  HeaderText="Severity"   
                        SortExpression="Severity"  ItemStyle-BorderColor="Black" ItemStyle-Wrap="false"   
                        ItemStyle-HorizontalAlign="Left" Groupable="False"   >   
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn  DataField="DisplayName" HeaderText="Display Name"   
                        SortExpression="DisplayName" ItemStyle-BorderColor="Black"   
                        ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Left"   
                        Groupable="False"   >   
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn  DataField="Description" HeaderText="Description"   
                        SortExpression="Description" ItemStyle-BorderColor="Black"   
                        ItemStyle-Wrap="false" ItemStyle-HorizontalAlign="Left"   
                        Groupable="False"  >   
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn  DataField="TimeFirst" HeaderText="Time First"   
                        SortExpression="TimeFirst" ItemStyle-BorderColor="Black" ItemStyle-Wrap="false"   
                        ItemStyle-HorizontalAlign="Left" Groupable="False" >   
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn  DataField="TimeLast" HeaderText="Time Last"   
                        SortExpression="TimeLast" ItemStyle-BorderColor="Black" ItemStyle-Wrap="false"   
                        ItemStyle-HorizontalAlign="Left" Groupable="False" >   
                    </telerik:GridBoundColumn> 
                     <telerik:GridBoundColumn  DataField="AckedBy" HeaderText="Acked By"   
                        SortExpression="AckedBy" ItemStyle-BorderColor="Black" ItemStyle-Wrap="false"   
                        ItemStyle-HorizontalAlign="Left" EmptyDataText="UnAcked"   
                        Groupable="False" >   
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn  DataField="TimeAcked" HeaderText="Time Acked"   
                        SortExpression="TimeAcked" ItemStyle-BorderColor="Black" ItemStyle-Wrap="false"   
                        ItemStyle-HorizontalAlign="Left" EmptyDataText="UnAcked"   
                        Groupable="False" >   
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn  DataField="OccurrenceCount"   
                        HeaderText="Occurrence Count" SortExpression="OccurrenceCount"   
                        ItemStyle-BorderColor="Black" ItemStyle-Wrap="false" Groupable="False">   
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn  DataField="NewOccurrenceCount"   
                        HeaderText="New Occurrence Count" SortExpression="NewOccurrenceCount"   
                        ItemStyle-BorderColor="Black" ItemStyle-Wrap="false" >    
                    </telerik:GridBoundColumn> 
              </Columns> 
                </MasterTableView> 
                 <SortingSettings  EnableSkinSortStyles="false" />   
                <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True"  AllowDragToGroup="false">  
                    <Resizing AllowColumnResize="True"/>   
                    <Selecting AllowRowSelect="True" /> 
<ClientEvents OnRowSelected="RadGrid1_RowSelected" OnRowDeSelected="RadGrid1_RowDeselected"  OnRowCreated="RadGrid1_RowCreate" OnRowContextMenu="RowContextMenu"  /> 
                    <Resizing AllowRowResize="False" /> 
                   </ClientSettings> 
                  
                 <SelectedItemStyle ForeColor="Aqua" /> 
                  
                 </telerik:RadGrid>       

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 May 2010, 06:36 AM
Hello Pei Chen,

I didn't experience this issue, when I tried the same in my application. One suggestion in your case is attach OnCommand client event and check for the CommandName whether it is 'GroupByColumn' and then cancel the evnt, which in turn cacel the grouping funtion.

javascript:
 
    function OnCommand(sender,args) { 
        if (args.get_commandName()=="GroupByColumn"
        { 
            args.set_cancel(true); 
        } 
    } 

I found a forum which discusses similar kind of issue. Please go through this forum.

Regards,
Shinu.
0
Pei Chen
Top achievements
Rank 1
answered on 04 May 2010, 02:44 PM
Hi Shinu,

Thanks for your reply.  I finally found the culprit.  It's this property:
AllowColumnsReorder="True"

Once I remove it, the DragToGroup function turned off.  I forgot why I put that in there.  The sorting looks fine without it.  Can you tell me what this is for? and it is necessary for sorting?

Thanks,
Pei
Tags
Grid
Asked by
Pei Chen
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Pei Chen
Top achievements
Rank 1
Share this question
or