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. Image for the cookie policy date

group-by cell type

When you have a grid grouped, and the grouped column header appears in the group-by area above the column headings, what cell-type is that?

Im trying to set the appearance of this cell (change backcolor to lightgray) but I cant seem to find which cell-type in the various Appearance sections correspond to this cell.

Please see attached image.


Thanks for any help

Group header cell backcolour.zip

4 Replies

RA Rajagopal Syncfusion Team August 29, 2007 10:45 PM UTC

Hi Michael,

To change the apearance in the GridGroupDropArea, you need catch the PrepareViewStyleInfo event of the GridGroupDropArea. Please try the below code.

// form load
gridGroupingControl1.GridGroupDropArea.PrepareViewStyleInfo += new GridPrepareViewStyleInfoEventHandler(GridGroupDropArea_PrepareViewStyleInfo);

void GridGroupDropArea_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
if (this.gridGroupingControl1.TableDescriptor.GroupedColumns.Count > 0)
{
e.Style.BackColor = Color.BurlyWood;
e.Style.TextColor = Color.White;
e.Style.Borders.All = new GridBorder(GridBorderStyle.None);
}
}

Let me know if you have any other questions.

Have a nice time.
Regards,
Rajagopal


DI do i have to September 5, 2007 04:23 PM UTC

Thanks Rajagopal, but I was really just trying to change the backcolor on the "Meter" button (col header) in the GridGroupDropArea, not the GridGroupDropArea itself. Now the button does change but I believe its because it inherits the changes to the GridGroupDropArea. Is there any way to just change the colheader of the grouped column that appears in the GridGroupDropArea when grouped? please see the attachment for clarification.

Thanks for your help so far :)

Group header cell backcolour 2.zip


RA Rajagopal Syncfusion Team September 6, 2007 10:35 PM UTC

Hi Michael,

Please try the modified code below in the GridGroupDropArea.PrepareViewStyleInfo event handler. This seems to work fine as desired.

void GridGroupDropArea_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
if (this.gridGroupingControl1.TableDescriptor.GroupedColumns.Count > 0)
{
if (e.RowIndex == 2 && e.ColIndex == 4)
{
e.Style.BackColor = Color.LightGray;
e.Style.TextColor = Color.Red;
e.Style.Themed = false;
}
}
}

Let me know if you have any other questions.

Regards,
Rajagopal


DI do i have to September 7, 2007 03:28 PM UTC

That works much better, thank you so much for your help :)

Loader.
Live Chat Icon For mobile
Up arrow icon