The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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);
ADAdministrator Syncfusion Team 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.
JRJoseph RezukeJuly 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.