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

How to Bold all data in one column of a GroupGrid

Thread ID:





43345 Apr 20,2006 06:59 PM UTC Apr 20,2006 09:01 PM UTC WinForms 4
Tags: GridControl
Craig Glencross
Asked On April 20, 2006 06:59 PM UTC

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.

Jayakumar Natarajan [Syncfusion]
Replied On 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\\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

Craig Glencross
Replied On 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.

Craig Glencross
Replied On 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,

Jayakumar Natarajan [Syncfusion]
Replied On 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


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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