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

Grid Control and Drop Down list control Background Color

Thread ID:





43498 Apr 24,2006 09:38 PM UTC Apr 25,2006 04:43 AM UTC WinForms 2
Tags: GridControl
Montesh Chhabria
Asked On April 24, 2006 09:38 PM UTC

Hey, Need to know how to avoid the change in the background color when I click the GridListControl. the problem is when I select a particular row, the selected color is automatically set to Black and this sets the background color of the GridList control to black but keeps the forecolor as well to black and this makes the readability to zero. Now, how can I set the selection color of the grid and avoid it from auto setting to Black. thanks & regards, Montesh

Administrator [Syncfusion]
Replied On April 25, 2006 04:27 AM UTC

Hi Montesh, You need to handle the Grid''s CurrentCellShowingDropDown and ListControlPart.Grid ''s PrepareviewStyle event .Here is a code snippet. private void gridControl1_CurrentCellShowingDropDown(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellShowingDropDownEventArgs e) { GridCurrentCell cc = this.gridControl1.CurrentCell; GridDropDownGridListControlCellRenderer cr = cc.Renderer as GridDropDownGridListControlCellRenderer; if(cr != null) { cr.ListControlPart.Grid.PrepareViewStyleInfo +=new GridPrepareViewStyleInfoEventHandler(Grid_PrepareViewStyleInfo); } } private void Grid_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e) { e.Style.BackColor = Color.YellowGreen; } Let me know if this helps. Regards, Haneef

Administrator [Syncfusion]
Replied On April 25, 2006 04:43 AM UTC

Hi Montesh, The selection behavior of the grid can be defined using the AllowSelection property. (Grid.AllowSelection = GridSelectionFlags.Row|GridSelectionFlags.AlphaBlend;) And the alpha blend selection color can be set using the AlphaBlendSelectionColor property. Please refer to the sample for more details. Let us know if you need any further assistance. Regards, Calvin.



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