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

trying to learn

Thread ID:





5386 Jul 1,2003 02:57 PM UTC Jul 1,2003 10:36 PM UTC WinForms 2
Tags: GridControl
Joseph Rezuke
Asked On July 1, 2003 02:57 PM UTC

In the grid sample for GridInfoStyleAtWork there is the following method for applying the user defined base style. private void ApplyBaseCheck(GridStyleInfo style, CheckBox check, ColorPickerButton _color) { _color.BackColor = _color.SelectedColor; GridStyleInfo style1 = new GridStyleInfo(); if(check.Checked) { style.BackColor = _color.SelectedColor; style1.BaseStyle = "BackColorTest"; gridControl1.ChangeCells(GridRangeInfo.Cells(2, 1, 4, 3), style1); } else { style1.ResetBaseStyle(); gridControl1.ChangeCells(GridRangeInfo.Cells(2, 1, 4, 3), style1); } } } Why don't you pass style to the line below instead of instancing a new GridStyleInfo? gridControl1.ChangeCells(GridRangeInfo.Cells(2, 1, 4, 3), style1);

Administrator [Syncfusion]
Replied On July 1, 2003 09:17 PM UTC

1) style.BackColor = _color.SelectedColor; 2) style1.BaseStyle = "BackColorTest"; 3) gridControl1.ChangeCells(GridRangeInfo.Cells(2, 1, 4, 3), style1); style is the basestyle.StyleInfo. Line (1) sets the backcolor of this basestyle. Line (2) sets the BaseStyle property of the new style1. And finally, in line (3) the ChangeCells says to make the BaseStyle property of the cells in the range to be BackColorTest. What this means is that, later, when you make a change to the BackColorTest basestyle, these cells will automatically reflect the change. If we do as you suggest, you are saying to apply the basestyle settings to the range. At first this would create the same display because the cell styles in the range would be modified to be the same as the basestyles. But we would not actually be setting the BaseStyle property of each cell in the range. This means, that if we later change the BackColorTest base style, the change will not be automatically reflected in the range of cells.

Joseph Rezuke
Replied On July 1, 2003 10:36 PM UTC

Thanks Clay, you're explanation is very clear. The point I was missing is that you have to set the BaseStyle property for the cells GridStyleInfo object.


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