Grouping single column at a time

Thread is closed for posting
4 posts, 0 answers
  1. 63F75A2C-1F16-4AED-AFE8-B1BBD57646AD
    63F75A2C-1F16-4AED-AFE8-B1BBD57646AD avatar
    1572 posts
    Member since:
    Oct 2004

    Posted 16 Mar 2006 Link to this post

     

    Requirements

    RadGrid for ASP .NET version

    RadControls for ASP .NET AJAX version

    3.0.3 and later


    2008.1.415 and later

    .NET version

    2.0 and later

    Visual Studio version

    2005 and later

    Programming language

    C#

    Browser support

    all supported by RadGrid for ASP .NET


    all browsers supported by RadControls for ASP .NET AJAX


    To enable grouping of a single column at a time:

    1. hook the GroupsChanging event of r.a.d.grid
    2. in the respective event handler determine where the current action is dropping column in the group panel
    3. if this is the case and the GroupByExpressions collection of the grid is not empty
      - cancel the default action
      - clear the GroupByExpression collection
      - add the current expression (hold by the e.Expression argument) to that collection
    4. rebind the grid calling its Rebind() method

     

  2. 28A933CF-6DF4-4E55-BAE1-5B8480B2527F
    28A933CF-6DF4-4E55-BAE1-5B8480B2527F avatar
    7 posts
    Member since:
    Nov 2006

    Posted 01 Feb 2007 Link to this post

    Is there source code for the .NET 1.1?
  3. 23C72464-8FC9-43C3-9A12-B431B37B7758
    23C72464-8FC9-43C3-9A12-B431B37B7758 avatar
    11 posts
    Member since:
    Dec 2013

    Posted 02 Feb 2007 Link to this post

    Hi Krefftc,

    Basically, the approach will be the same. The only difference would be that you will need to use NeedDataSource, instead of the AccessDataSource. The rest of the functionality is handled in the GroupsChanging event handler, as shown below:

    .cs
    protected void RadGrid1_GroupsChanging(object source, GridGroupsChangingEventArgs e)  
        {  
            if (e.Action == GridGroupsChangingAction.Group)  
            {  
                if (RadGrid1.MasterTableView.GroupByExpressions.Count > 0)  
                {  
                    e.Canceled = true;  
                    RadGrid1.MasterTableView.GroupByExpressions.Clear();  
                    RadGrid1.MasterTableView.GroupByExpressions.Add(e.Expression);  
                }  
     
                RadGrid1.MasterTableView.Rebind();  
            }  
        } 

    I hope this helps.

    Have a nice day,
    Yavor

    the telerik team
  4. AC2420A5-C717-47D1-8DD9-C0F9CAF0FE44
    AC2420A5-C717-47D1-8DD9-C0F9CAF0FE44 avatar
    9 posts
    Member since:
    Jun 2009

    Posted 20 Jul 2011 Link to this post

    Dear,

    Can I hide the group panel.


    Regards,
Back to Top

This Code Library is part of the product documentation and subject to the respective product license agreement.