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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Hidden column indicator

Thread ID:





36971 Nov 14,2005 12:25 PM UTC Nov 21,2005 08:43 AM UTC WinForms 4
Tags: Grouping
Andreas Liebenberg
Asked On November 14, 2005 12:25 PM UTC

Hi, When a column is resized to have a width of 0, I want the seperator in the column headings to appear thicker, to indicate that there are a hidden column. (Like in Excell) Two Questions: 1) Is there a simple property I can set to get this behaviour? 2) If not, I tried the following code relying on the QueryCellStyleInfo and all seems fine, but when I have nested tables in the grid, the QueryCellStyleInfo does not fire for all columns, what might cause this? Another problem is that this event does not fire for the nested tables. private void My_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e) { if (e.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell || e.TableCellIdentity.TableCellType == GridTableCellType.TopLeftHeaderCell ) { GridColumnDescriptor gcd = this.TableDescriptor.Columns[e.TableCellIdentity.ColIndex]; if (gcd != null && gcd.Width <= 0 ) { e.Style.Borders.Right = new GridBorder(GridBorderStyle.Solid, Color.Black, GridBorderWeight.Thick); } }

Administrator [Syncfusion]
Replied On November 14, 2005 12:33 PM UTC

There is no property setting that would do this for you. QueryCellStyleInfo should be raised for all cells no matter whether they are in nested tables or not whenever the grid needs a style. In your code, you use this.TableDescriptor.Columns. This only has the columns in the parent table. Instead, try using e.TableCellIdentity.Table.TableDescriptor.Columns which should pick out the current (maybe nested)TableDescriptor.Columns.

Andreas Liebenberg
Replied On November 16, 2005 05:25 AM UTC

Hi, This is my code to Debug, I do NOT see all my columns headers, somehow the second column never goes through this with type "ColumnHeaderCell", Seems like all the others do. This happens on the parent table if it has nested tables. It does however show up as type "RecordFieldCell" but then it must be drawing the values. I never see the "ERROR !!!" in the parent table. What can I look for? private void MyGrid_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e) { try { GridColumnDescriptor gcd = e.TableCellIdentity.Table.TableDescriptor.Columns[e.TableCellIdentity.ColIndex]; Trace.WriteLine(gcd.HeaderText + " " + e.TableCellIdentity.ColIndex.ToString() + " Type " + e.TableCellIdentity.TableCellType.ToString() + " Width " + gcd.Width.ToString()); } catch { Trace.WriteLine("ERROR !!!!!!!!!!!!!!!!!"); } }

Administrator [Syncfusion]
Replied On November 16, 2005 09:34 AM UTC

You can use e.TableCellIdentity.TabelCellType to pick out the column header cells. Here is a sample. http://www.syncfusion.com/Support/user/uploads/GGC_Nested_943c78ec.zip

Administrator [Syncfusion]
Replied On November 21, 2005 08:43 AM UTC

Thanks a lot, the code in the sample works like a charm.


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