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.
Unfortunately, activation email could not send to your email. Please try again.

group-by cell type

Thread ID:

Created:

Updated:

Platform:

Replies:

67766 Aug 29,2007 02:03 PM Sep 7,2007 11:28 AM Windows Forms 4
loading
Tags: GridControl
Michael Wortman
Asked On August 29, 2007 02:03 PM

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

Rajagopal [Syncfusion]
Replied On August 29, 2007 06:45 PM

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

do i have to
Replied On September 5, 2007 12:23 PM

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

Rajagopal [Syncfusion]
Replied On September 6, 2007 06:35 PM

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

do i have to
Replied On September 7, 2007 11:28 AM

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

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.

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.

;