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

[Solved] Hide Group Panel when no records

2 Answers 284 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 24 Jun 2014, 08:13 PM
Greetings,

My RadGrid's MasterTableView is set for ShowHeadersWhenNoRecords="False".  Is there a similar setting for the Group Panel (Drag a column header and drop it here to group by that column) above the header?

Your assistance is appreciated!

Matt

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 25 Jun 2014, 04:14 AM
Hi Matt,

There is no direct property to set this, you can check the count in the PreRender event and set ShowGroupPanel property to true/false when needed.

C#:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
  if (RadGrid1.MasterTableView.Items.Count == 0)
  {
    RadGrid1.ShowGroupPanel = false;
  }
  else
  {
    RadGrid1.ShowGroupPanel = true;         
  }
}

Thanks,
Princy
0
Matt
Top achievements
Rank 1
answered on 25 Jun 2014, 03:10 PM
Thank you Princy.

It seems strange that the Group Panel would show if I am trying to hide the header when no records.  Especially when the default message is referencing "column headers" which are hidden by the ShowHeadersWhenNoRecords="false".  I will mark this as the answer, but I wish this could go to your enhancement list.

Matt
Tags
Grid
Asked by
Matt
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Matt
Top achievements
Rank 1
Share this question
or