We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GCC: how to hide header of empty child table

Thread ID:

Created:

Updated:

Platform:

Replies:

53637 Dec 18,2006 10:57 AM UTC Dec 20,2006 09:31 AM UTC WinForms 3
loading
Tags: GridControl
Cuong Luc
Asked On December 18, 2006 10:57 AM UTC

Hi,

I have a nested table using GCC. If a child table has data, it display well. However if child table does not have any data row, it shows the header only, and this make user a bit confusing (like in the attached image).

Is there a way to hide header of empty child table? If there is, please tell me ^_^.

Thanks and regards,

Cuong Luc.

sample89.zip

Administrator [Syncfusion]
Replied On December 18, 2006 11:49 AM UTC

Hi Cuong,

You could try this in the QueryCellStyleInfo event handler. Here is some code that hides the +/- pushbutton for the records that doesn't have child records, you can handle the QueryCellStyleInfo checking for the nestedtable's record count and set the +/- pushbutton celltype to Static/Header.

private void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
if(e.Style.CellType == "PushButton")
{
if(e.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Record)
{
Record rec = (Record) e.TableCellIdentity.DisplayElement.ParentRecord;
if(rec.NestedTables[0].FilteredRecords.Count == 0)
{
e.Style.CellType = "Static";
e.Style.Enabled = false;
}
}
}
}

Please refer to the attached sample for implementation.
Here is a sample

Best regards,
Haneef

Cuong Luc
Replied On December 20, 2006 09:14 AM UTC

Thanks for your help, Haneef. If we use this approach, there's a white space for each "Static" cell. I think it's better if the first column (the tiny column on the left that has the black arrow) is hidden. Could I make it hidden?

Regards,

Cuong Luc.

>Hi Cuong,

You could try this in the QueryCellStyleInfo event handler. Here is some code that hides the +/- pushbutton for the records that doesn't have child records, you can handle the QueryCellStyleInfo checking for the nestedtable's record count and set the +/- pushbutton celltype to Static/Header.

private void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
if(e.Style.CellType == "PushButton")
{
if(e.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Record)
{
Record rec = (Record) e.TableCellIdentity.DisplayElement.ParentRecord;
if(rec.NestedTables[0].FilteredRecords.Count == 0)
{
e.Style.CellType = "Static";
e.Style.Enabled = false;
}
}
}
}

Please refer to the attached sample for implementation.
Here is a sample

Best regards,
Haneef

Administrator [Syncfusion]
Replied On December 20, 2006 09:31 AM UTC

Hi Cuong,

Try setting the TableOptions.ShowRowHeader property to hide/show the first column(rowheader) of the Grid. Here is a code snippet

this.gridGroupingControl1.TableOptions.ShowRowHeader = false;

Best Regards,
Haneef

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;