How do I hide Group Headings?

6 posts, 0 answers
  1. Howard
    Howard avatar
    5 posts
    Member since:
    Aug 2009

    Posted 19 Aug 2015 Link to this post

    How do I hide group row headings (see attached image) without affecting the group footers?

    I am using 2015 Q2.

     

    Thanks,

    Howard

  2. Dimitar
    Admin
    Dimitar avatar
    1936 posts

    Posted 20 Aug 2015 Link to this post

    Hi Howard,

    Thank you for writing.

    You can use the ViewCellFormatting event and remove the text:
    void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
    {
        if (e.Row is GridViewGroupRowInfo)
        {
            e.CellElement.Text = "";
        }
    }

    Please let me know if there is something else I can help you with. 
     
    Regards,
    Dimitar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Howard
    Howard avatar
    5 posts
    Member since:
    Aug 2009

    Posted 20 Aug 2015 in reply to Dimitar Link to this post

    That did not work. All it did was to wipe out the text. I don't want the rows to appear.

    I tried e.Height = 0, but that didn't work either.

    In previous versions (prior to 2015 Q2) radGridView1.TableElement.GroupHeaderHeight = 0;

    Howard 

     

  4. Dimitar
    Admin
    Dimitar avatar
    1936 posts

    Posted 25 Aug 2015 Link to this post

    Hello Howard,

    Thank you for writing back.

    I have tested this locally and the rows are hidden when the GroupHeaderHeight is set to 0. I have tested this with the latest and the Q1 2015 SP1 versions and the results are the same. This is why I have attached my test project. Could you please check it and let me know how it differs from your real setup? 

    In addition could you please specify which previous version you have used?

    Thank you in advance for your patience and cooperation. 
     
    Regards,
    Dimitar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Michael
    Michael avatar
    15 posts
    Member since:
    Nov 2014

    Posted 29 Jun Link to this post

    Hello,

    I have a RadGridView and I'm filtering by making rows not Visible based on checkboxes from another control.  This works fine until you drag column header to group.  RadGridView shows row headers when there is actually nothing to see when you expand because rows are hidden.  I'm trying to use the GroupSummaryEvaluate event to hide the GroupRow if there are no visible rows

    int visibleRowCount = 0;
    foreach (GridViewRowInfo row in e.Group)
    {
        if (row.IsVisible)
            visibleRowCount++;
    }
    if (visibleRowCount == 0)
        e.Group.GroupRow.IsVisible = false;
    else
        e.Group.GroupRow.IsVisible = true;

     

    This is sort of working, but i still see GroupRows until i click the down arrow on one of them and then they all vanish, except the ones that actually have visible rows.  Am I doing this wrong?  Is there a better way?  

    A secondary problem occurs when you click a filter to add rows back (make then IsVisible = true) in that the group header doesn't come back for visible rows, until the control is ungrouped, then regrouped.  Hope this makes sense.  Thanks.

  6. Dimitar
    Admin
    Dimitar avatar
    1936 posts

    Posted 03 Jul Link to this post

    Hi Michael,

    You need to hide/show the group rows each time when the filtering or grouping are changed. For example, you can use the FilterChanged or GroupByChanged events. Here is how you can get the group rows:
    foreach (var item in radGridView1.ChildRows)
    {
        if (item is GridViewGroupRowInfo)
        {
            var groupRow = item as GridViewGroupRowInfo;
            if (!groupRow.ChildRows.Where(x => x.IsVisible == true).Any())
            {
                groupRow.IsVisible = false;
     
            }
            else
            {
                groupRow.IsVisible = true;
            }
        }
    }

    I hope this will be useful. Let me know if you have additional questions.

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top