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

Style for a drop down GridListControl

Thread ID:

Created:

Updated:

Platform:

Replies:

4497 May 15,2003 12:42 PM UTC May 15,2003 05:51 PM UTC WinForms 3
loading
Tags: GridControl
Martin Brodeur
Asked On May 15, 2003 12:42 PM UTC

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 03:17 PM UTC

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 04:48 PM UTC

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 05:51 PM UTC

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.

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

;