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. Image for the cookie policy date

Style for a drop down GridListControl

How can I change the style (ex: backcolor) of a GridListControl that is showed by a gridListControl cell?

3 Replies

AD Administrator Syncfusion Team May 15, 2003 10:17 AM

You can handle the gridListControl.Grid.PreparepareViewStyleInfo event, and based on the e.ColIndex and e.RowIndex, set e.Style.BackColor.


MB Martin Brodeur May 15, 2003 11:48 AM

Bu when i add a GridListControl to a GridBoundColumn this way : --------------------------- col = New GridBoundColumn col.MappingName = "IdEmployee" With col.StyleInfo .CellType = "GridListControl" .DisplayMember = DataSet12.Employees.EmployeeNamecolumn.ColumnName .ValueMember = DataSet12.Employees.EmployeeIdColumn.ColumnName .DataSource = DataSet12.Employees End With --------------------------- I don't have access to the avents raised by the GridListControl?


AD Administrator Syncfusion Team May 15, 2003 12:51 PM

I am sorry I missed the part about the grid cell. To get at the embedded GridListControl in a cell to hook its grid's prepareviewstyleinfo, you can use code like this in your FormLoad: Dim cellRenderer As GridDropDownGridListControlCellRenderer = Me.gridControl1.CellRenderers("GridListControl") Dim gridList As GridListControl = cellRenderer.ListControlPart AddHandler gridList.Grid.PrepareViewStyleInfo, AddressOf gridlist_PrepareViewStyleInfo Then the handler can do soemthing like: Private Sub gridlist_PrepareViewStyleInfo(ByVal sender As Object, ByVal e As GridPrepareViewStyleInfoEventArgs) If e.RowIndex Mod 2 = 1 Then e.Style.BackColor = Color.LightCoral End If End Sub This code will change the backcolor everytime the gridlistcontrol is shown.

Loader.
Live Chat Icon For mobile
Up arrow icon