NA
Nisha Arockiya A
Syncfusion Team
September 29, 2008 12:59 PM UTC
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