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.

Style for a drop down GridListControl

Thread ID:





4497 May 15,2003 08:42 AM May 15,2003 01:51 PM Windows Forms 3
Tags: GridControl
Martin Brodeur
Asked On May 15, 2003 08:42 AM

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

Administrator [Syncfusion]
Replied On May 15, 2003 11:17 AM

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

Martin Brodeur
Replied On May 15, 2003 12:48 PM

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?

Administrator [Syncfusion]
Replied On May 15, 2003 01: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.


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.

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.