How to Bold all data in one column of a GroupGrid
I have a group grid and it is used to show three types of data (datasets). For one of the grids the first column should not be visible and the second should be bold.
How do I do this programatically?
Thanks.
SIGN IN To post a reply.
4 Replies
JN
Jayakumar Natarajan
Syncfusion Team
April 20, 2006 07:50 PM UTC
Hi Craig,
You can acheive this by setting the following properties in the TableDescriptor. To set these in the Child/GrandChild table, you need to go through the corresponding TableDescriptor.
Here is the modified ManualRelations sample (C:\Program Files\Syncfusion\Essential Studio\4.1.0.62\windows\Grid.Grouping.Windows\Samples\ManualRelations).
//ParentTableDescriptor
//Remove the first column - parentID
this.gridGroupingControl1.TableDescriptor.VisibleColumns.Remove("parentID");
//Make the second column BOLD
this.gridGroupingControl1.TableDescriptor.Columns["ParentName"].Appearance.AnyRecordFieldCell.Font.Bold = true;
// ChildTableDescriptor
// Get the child tabledescriptor for a particular relation
GridTableDescriptor child_tabledescriptor = this.gridGroupingControl1.TableDescriptor.Relations["MyChildTable"].ChildTableDescriptor;
//Remove the first column - parentID
child_tabledescriptor.VisibleColumns.Remove("childID");
//Make the second column BOLD
child_tabledescriptor.Columns["Name"].Appearance.AnyRecordFieldCell.Font.Bold = true;
// GrandChildTableDescriptor
// Get the grandchild tabledescriptor for a particular relation
GridTableDescriptor grandchild_tabledescriptor = child_tabledescriptor.Relations["MyGrandChildTable"].ChildTableDescriptor;
//Remove the first column - parentID
grandchild_tabledescriptor.VisibleColumns.Remove("GrandChildID");
//Make the second column BOLD
grandchild_tabledescriptor.Columns["Name"].Appearance.AnyRecordFieldCell.Font.Bold = true;
Best regards,
Jay
CG
Craig Glencross
April 20, 2006 08:31 PM UTC
When a set a column to bold using:
grd.TableDescriptor.Columns(0).Appearance.AnyRecordFieldCell().Font.Bold = True
Only the one type of dataset (10 cols) will be able to be shown in the grid. The other two types of grids (25 and 31 cols) will have the correct number of rows but the columns will not reset to the new dataset''s (25 or 31) but will stay at 10 columns.
There is also no data displayed in the cells.
So click on node type 1:
set font to bold=true for column(1)
10 cols 15 rows data is displayed
So click on node type 2:
set font to bold=false for column(1)
25 cols 620 rows data is NOT displayed
So click on node type 3:
set font to bold=false for column(1)
31 cols 611 rows data is NOT displayed
Thanks.
CG
Craig Glencross
April 20, 2006 08:43 PM UTC
Ive determined that you need to reset the columns using
grd.TableDescriptor.Columns.Reset()
after you format a column. If you dont then the columns will be hardcoded to the number and style they were when the style was changed. This will persist even if you assocaited a new dataset with a different number of columns and rows to the grid.
Can this be changed in a future release? Just because you want to bold the first column of a row it should not hard set the number of columns from then on out.
Thanks,
JN
Jayakumar Natarajan
Syncfusion Team
April 20, 2006 09:01 PM UTC
Hi Craig,
Thanks for the feedback. Just before assigning the new datasource, you need to reset the TableDescriptor and Relations to clear out all the cache.
this.gridGroupingControl1.ResetTableDescriptor();
this.gridGroupingControl1.TableDescriptor.Relations.Reset();
\\windows\Grid.Grouping.Windows\Samples\GridGroupingRebind
You need to do this before assiging the new datasource everytime. But I will pass on your suggestions to the Grid architect.
Best Regards,
Jay
SIGN IN To post a reply.
- 4 Replies
- 2 Participants
-
CG Craig Glencross
- Apr 20, 2006 06:59 PM UTC
- Apr 20, 2006 09:01 PM UTC