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.
Syncfusion Feedback

How set a different color to a drop down grid ?

Thread ID:

Created:

Updated:

Platform:

Replies:

31670 Jul 12,2005 02:46 PM UTC Jul 12,2005 06:31 PM UTC Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On July 12, 2005 02:46 PM UTC

Hi, I use this code : If StatutTache(Me.gridFavoris(cc.RowIndex, COL_TACHE).CellValue) = False Then Me.gridFavoris.RowStyles(cc.RowIndex).BackColor = Color.Red Else If StatutProjet(Me.gridFavoris(cc.RowIndex, COL_PROJET).CellValue) = STATUT_PROJET_VALIDE Then Me.gridFavoris.RowStyles(cc.RowIndex).BackColor = Color.White End If End If to validate on a drop down element and set the red color on error for all the row of a databound grid. But, I want to set the white color to my drop down list. The problem that I see is that my drop down list inherits of my cell and the red color. I can''t by pass this. How I can do that !!! thanks

Administrator [Syncfusion]
Replied On July 12, 2005 06:31 PM UTC

I am not really sure why this is working for you in a GridDataBoundGrid (unless you have explicitly set grid.Model.RowCount to allocate space for row styles). Normally, a GridDataBoundGrid does not have rowstyles. Anyway, you can try handling the CurrentCellShowingDropdown event and set the backcolor of the drop list there. Private Sub gridControl1_CurrentCellShowingDropDown(sender As Object, e As GridCurrentCellShowingDropDownEventArgs) Dim cc As GridCurrentCell = Me.gridControl1.CurrentCell Dim cr As GridComboBoxCellRenderer = cc.Renderer '' If Not (cr Is Nothing) Then cr.ListBoxPart.BackColor = Color.LightGoldenrodYellow End If End Sub ''gridControl1_CurrentCellShowingDropDown

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.

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

;