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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback


Thread ID:





34816 Sep 16,2005 12:10 PM UTC Sep 19,2005 06:06 AM UTC WinForms 2
Tags: GridControl
Administrator [Syncfusion]
Asked On September 16, 2005 12:10 PM UTC

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

Administrator [Syncfusion]
Replied On 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

Administrator [Syncfusion]
Replied On September 19, 2005 06:06 AM UTC

Thanks Jay, that works great.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon