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.

GridGroupingControl question

Thread ID:

Created:

Updated:

Platform:

Replies:

76805 Sep 24,2008 05:18 PM Sep 29,2008 08:59 AM Windows Forms 1
loading
Tags: GridControl
Anuvrat
Asked On September 24, 2008 05:18 PM

Hi,

I am working on this control. I had few questions related with control. Hopefully you will be able to answer them.

1. If I want to change the color of the selected row in this control how should I do that. Default it is showing me orange color. I would like it to change to blue
2. If I want to change the text color of elements in the selected row , how do I do that. Default color it is showing me white. I would like it to turn to black .
3. The group header when clicked turns to color black. Is it possible to change the color of it?


Are there any properties or functions I need to setup?


-Anuvrat


Nisha Arockiya A [Syncfusion]
Replied On September 29, 2008 08:59 AM


Hi Anuvrat,

Thanks for your interest in Syncfusion Products.

Query 1:

You have to include the Alphablend flag in the Allowselection property. To control the selection color better, you can turn off the color in alhablend selection color and handle PrepareViewStyleInfo.
Here is some code snippet:


// In Form Load
this.gridGroupingControl1.TableModel.Options.AlphaBlendSelectionColor = Color.FromArgb(0,0,0,0);
this.gridGroupingControl1.TableModel.Options.AllowSelection = (Syncfusion.Windows.Forms.Grid.GridSelectionFlags.Row | Syncfusion.Windows.Forms.Grid.GridSelectionFlags.AlphaBlend);

// PrepareViewStyleInfo
private void gridGroupingControl1_TableControlPrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlPrepareViewStyleInfoEventArgs e)
{
if(this.gridGroupingControl1.TableControl.Selections.Ranges.AnyRangeContains(GridRangeInfo.Cell(e.Inner.RowIndex, e.Inner.ColIndex)) && !this.gridGroupingControl1.TableControl.CurrentCell.IsEditing) e.Inner.Style.BackColor = Color.Blue;
}


Query 2:

Handle the same PrepareViewStyleInfo as above and set the text color of the selected row.
e.Style.TextColor = Color.Black;

Query 3:

Inorder to change the color or the group header,Please try this code snippet and let us know if this helps.

private void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
if(e.TableCellIdentity.TableCellType==GridTableCellType.GroupCaptionCell)
{
e.Style.TextColor=Color.Red;
}
}

Please let me know if this helps.

Regards,
Nisha


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.

;