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

ColumnHeaderCell and GridTableCellStyleInfo

Thread ID:

Created:

Updated:

Platform:

Replies:

35308 Sep 28,2005 12:35 AM UTC Sep 28,2005 11:43 PM UTC WinForms 4
loading
Tags: Grouping
Simon Fielke
Asked On September 28, 2005 12:35 AM UTC

I have assigned a GridTableCellStyleInfo to the ColumHeaderCell but the style does not appear until I click (and hold the mouse down) on the header cell, as required to sort the column. Is it possible to display assigned style without clicking on it? I tryed the following line; grid.Appearance.ColumnHeaderCell.Themed = false; but this had no effect. Thank you for your help

Administrator [Syncfusion]
Replied On September 28, 2005 02:20 AM UTC

Simon, I attached a sample. Look at the ctor. It sets the column header back color to green and just works fine. CS.zip Let me know if you do something different. Thanks, Stefan >I have assigned a GridTableCellStyleInfo to the ColumHeaderCell but the style does not appear until I click (and hold the mouse down) on the header cell, as required to sort the column. Is it possible to display assigned style without clicking on it? I tryed the following line; grid.Appearance.ColumnHeaderCell.Themed = false; but this had no effect. > >Thank you for your help

Administrator [Syncfusion]
Replied On September 28, 2005 05:20 AM UTC

Hi Stefan, Thanks for your reply and the example code. I am able set the backcolor of the ColumnHeaderCells in my grid, using the sample code that you supplied. However, I am unable to set the GridTableCellStyleInfo of the ColumnHeaderCells. The code I use is below: GridTableCellStyleInfo cellstyle = new GridTableCellStyleInfo(); cellstyle.BaseStyle = "Header"; grid.BorderStyle = BorderStyle.FixedSingle; cellstyle.Interior = new Syncfusion.Drawing.BrushInfo(Syncfusion.Drawing.GradientStyle.Vertical, SystemColors.Control, SystemColors.ControlLightLight); cellstyle.Borders.Top = new GridBorder(GridBorderStyle.Solid, SystemColors.ControlLightLight, GridBorderWeight.Thin); cellstyle.Borders.Left = new GridBorder(GridBorderStyle.Solid, SystemColors.ControlLightLight, GridBorderWeight.Thin); cellstyle.Borders.Bottom = new GridBorder(GridBorderStyle.Solid, SystemColors.ActiveBorder, GridBorderWeight.Thin); cellstyle.Borders.Right = new GridBorder(GridBorderStyle.Solid, SystemColors.ActiveBorder, GridBorderWeight.Thin); Syncfusion.Drawing.BrushInfo(Syncfusion.Drawing.GradientStyle.Horizontal, SystemColors.Control, SystemColors.ControlLightLight); Syncfusion.Drawing.BrushInfo(Syncfusion.Drawing.GradientStyle.ForwardDiagonal, SystemColors.Control, SystemColors.ControlLightLight); grid.Appearance.ColumnHeaderCell.Themed = false; grid.Appearance.ColumnHeaderCell = cellstyle; Thanks again for your help, Simon

Administrator [Syncfusion]
Replied On September 28, 2005 11:08 AM UTC

Hi Simon, Try setting this in the QueryCellStyleInfo event handler to see if that helps. GridTableCellStyleInfo cellstyle; public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); cellstyle = new GridTableCellStyleInfo(); cellstyle.BaseStyle = "Header"; cellstyle.Interior = new Syncfusion.Drawing.BrushInfo(Syncfusion.Drawing.GradientStyle.Vertical, SystemColors.Control, SystemColors.ControlLightLight); cellstyle.Borders.Top = new GridBorder(GridBorderStyle.Solid, SystemColors.ControlLightLight, GridBorderWeight.Thin); cellstyle.Borders.Left = new GridBorder(GridBorderStyle.Solid, SystemColors.ControlLightLight, GridBorderWeight.Thin); cellstyle.Borders.Bottom = new GridBorder(GridBorderStyle.Solid, SystemColors.ActiveBorder, GridBorderWeight.Thin); cellstyle.Borders.Right = new GridBorder(GridBorderStyle.Solid, SystemColors.ActiveBorder, GridBorderWeight.Thin); this.gridGroupingControl1.QueryCellStyleInfo +=new GridTableCellStyleInfoEventHandler(gridGroupingControl1_QueryCellStyleInfo); } private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e) { if(e.TableCellIdentity.DisplayElement.Kind == Syncfusion.Grouping.DisplayElementKind.ColumnHeader) { e.Style.Themed = false; e.Style.ModifyStyle(this.cellstyle, Syncfusion.Styles.StyleModifyType.Override); } } Best regards, Jay N

Administrator [Syncfusion]
Replied On September 28, 2005 11:43 PM UTC

Hi Jay, thanks for your help, the code works well.

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

;