GridListControl

Hi together, I have got a gridlistcontrol. How can I make the selected item color just the same as the color of other controls like listview or combobox. The selection color of a gridlistcontrol is light blue and the normal selected color of other controls is blue? Kind regards Franz

2 Replies

AD Administrator Syncfusion Team September 16, 2005 02:09 PM UTC

Hi Franz, You could handle the PrepareViewStyleInfo to do this. this.ListBox1.Grid.AlphaBlendSelectionColor = Color.FromArgb(1,0,0,0); this.ListBox1.Grid.PrepareViewStyleInfo +=new GridPrepareViewStyleInfoEventHandler(Grid_PrepareViewStyleInfo); private void Grid_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e) { if(e.ColIndex > 0 && e.RowIndex > 0) { GridRangeInfoList rangeList; if(this.ListBox1.Grid.Selections.GetSelectedRanges(out rangeList, false) && rangeList.AnyRangeIntersects(GridRangeInfo.Cell(e.RowIndex, e.ColIndex))) { e.Style.BackColor = Color.DarkBlue; e.Style.TextColor = Color.White; } } } Best regards, Jay N


AD Administrator Syncfusion Team September 19, 2005 06:06 AM UTC

Thanks Jay, that works great.

Loader.
Up arrow icon