Grid grouping collapse not disabled

3 posts, 0 answers
  1. Rod
    Rod avatar
    23 posts
    Member since:
    Aug 2007

    Posted 28 Oct 2008 Link to this post

    I have a simple grouped grid to which I have added the following code:

    protected void personalRadGrid_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
        {
            if (e.Column is GridGroupSplitterColumn)
            {
                e.Column.Visible = false;
            }
        }

    The grid also has a select column with check boxes.
    But now, when I click on a group header in the check box column (no check boxes in the group rows), the row still collapses.

    I've tried setting the AllowExpandCollapse and AllowGroupExpandCollapse in ClientSettings to false in the OnPreRender event of the page, but those don't seem to do anything.

    How can I effectively prevent the user to collapse the grid while hiding the collapse/expand column?
    This seems like a pretty common functionality that a lot of people struggle with.

    Thanks,

    Rod
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 28 Oct 2008 Link to this post

    Hi Rod,

    Try disabling the GroupSplitterColumn as shown below and see if it helps.

    CS:
    protected void RadGrid1_ColumnCreated(object  sender, Telerik.Web.UI.GridColumnCreatedEventArgs e) 
     if (e.Column is GridGroupSplitterColumn) 
     { 
       e.Column.HeaderStyle.Width = Unit.Pixel(1); 
       e.Column.HeaderStyle.Font.Size = FontUnit.Point(1); 
       e.Column.ItemStyle.Width = Unit.Pixel(1);   
       e.Column.ItemStyle.Font.Size = FontUnit.Point(1); 
     
       e.Column.Resizable = false
     } 

    You can also go through the following help article.
    Preventing groups expansion by hiding the expand/collapse images

    Thanks
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rod
    Rod avatar
    23 posts
    Member since:
    Aug 2007

    Posted 29 Oct 2008 Link to this post

    Hi Shinu,

    Thanks for your reply.

    I implemented the code you recommended, but it's not working quite properly.

    In Firefox, the grid now renders with the collapse column hidden, but the collapse image is still visible behind the text of the first column (and user can still click and collapse grid).
    In IE, grid renders with collapse column just wide enough to see the edge of the plus/minus image and again, user can still click and collapse the grid.

    I would attach an image/code sample if you could tell me how to do that in this forum.

    Thanks,

    Rod
Back to Top