Hiding Caption rows when no records

Is there an easy way to hide the header row (the one that typically reads "TableName: 0 Items") of a nested chid table when there are no records?

I'm sure the answer lies somewhere in the forum - excuse me if it's been asked before.


3 Replies

AD Administrator Syncfusion Team December 15, 2007 09:16 AM UTC

First comment is that you can turn off that caption line for all nested tables (whether or not they are empty) by setting:

this.gridGroupingControl1.NestedTableGroupOptions.ShowCaption = false;


Here is a forum thread that discusses how not to display the +/- cell for empty nested tables so your user cannot expand them (and hence the caption line is never visible).
http://www.syncfusion.com/Support/Forums/message.aspx?&MessageID=53637

If you really want to selectively just hide the caption row, then you would have to use a custom grouping engine which is sort of a big change to your application if you are not already using one for some reason. Here is a thread that has a sample where you can set rowheights to zero but it does require a custom engine.
http://www.syncfusion.com/Support/Forums/message.aspx?&MessageID=37998




MA Mark Atkinson December 17, 2007 06:32 PM UTC

Well, I need the caption to be turned on if the table has child records.

Using the code snippet with a couple of changes I was able to turn off the +/- in the puchbutton cell, but that didn't get rid of the entire caption row alltogether (which is what I want).
I'll keep playing with the code though..

>First comment is that you can turn off that caption line for all nested tables (whether or not they are empty) by setting:

this.gridGroupingControl1.NestedTableGroupOptions.ShowCaption = false;


Here is a forum thread that discusses how not to display the +/- cell for empty nested tables so your user cannot expand them (and hence the caption line is never visible).
http://www.syncfusion.com/Support/Forums/message.aspx?&MessageID=53637

If you really want to selectively just hide the caption row, then you would have to use a custom grouping engine which is sort of a big change to your application if you are not already using one for some reason. Here is a thread that has a sample where you can set rowheights to zero but it does require a custom engine.
http://www.syncfusion.com/Support/Forums/message.aspx?&MessageID=37998






AD Administrator Syncfusion Team December 19, 2007 01:00 PM UTC

Here is the sample back modified to use the custom engine technique to hide the CaptionRow for empty child tables by setting its row height to zero.




GGC_PasteSort.zip

Loader.
Up arrow icon