Alohameocon
2020-10-26T09:05:16Z
Hi every one.
I'm a newbie and I have a troble with iGrid's Group Column.
I have Grid like that, and i just want to set backcolor in the Group Row Col0:0, Col0:2, other dont fill backcolor.
Is this possible? And do you have any idea for this? Please tell me.
Thanks for read this question.
UserPostedImage
Igor/10Tec
2020-10-26T15:47:56Z
Use the iGrid.GroupRowLevelStyles[] property. Here is the pertinent excerpt from the documentation:

Quote:

When an automatic group row is created, its style object is determined automatically by using the GroupRowLevelStyles property. This property stores an array of style objects, and each item of the array is assigned to the corresponding level of grouping. For example, when the grid is being grouped by two columns, the first element of that array corresponds to the group rows created from the first column the grid is grouped by, and the second element - to the group rows created from the second column.

If the length of the array is less than the number of grouped columns, then the style object of a group row from nested levels which do not have the corresponding element in the GroupRowLevelStyles array will refer the style from the last element of the array. By default the GroupRowLevelStyles array has one item and all the group rows from any level refer this style object. This allows you to change the view of all the group rows you have simply by changing properties of this style object (you can do it even after you have grouped the grid because the Style property of each group row stores the reference to a style object from the GroupRowLevelStyles array).



Thus, you should define 2 items in this array. The first item will be used to specify the background color for the first level of grouping, the second item will define the background color for other levels of hierarchy:

iGrid1.GroupRowLevelStyles = new iGCellStyle[2];
iGrid1.GroupRowLevelStyles[0] = new iGCellStyle();
iGrid1.GroupRowLevelStyles[0].BackColor = Color.AliceBlue;
iGrid1.GroupRowLevelStyles[1] = new iGCellStyle();
iGrid1.GroupRowLevelStyles[1].BackColor = Color.SandyBrown;
Alohameocon
2020-10-27T06:06:41Z
Thanks for reply my question, Igor.
I will try you way.
Have a nice day.