Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
19929 | Oct 6,2004 03:12 PM UTC | Oct 6,2004 05:15 PM UTC | WinForms | 5 |
![]() |
Tags: GridControl |
''hook the handler say in FormLoad AddHandler Me.GridDataBoundGrid1.Model.QueryCellInfo, AddressOf GridQueryCellInfo ''also set the grid to refresh the whole row as the current cell changes Me.GridDataBoundGrid1.Model.Options.RefreshCurrentCellBehavior = GridRefreshCurrentCellBehavior.RefreshRow Me.GridDataBoundGrid1.Model.Options.RefreshCurrentCellBehavior = GridRefreshCurrentCellBehavior.RefreshRow ''the handler Private Sub GridQueryCellInfo(ByVal sender As Object, ByVal e As GridQueryCellInfoEventArgs) If e.ColIndex > 0 And e.RowIndex > 0 Then Dim colorRow As Boolean = False If e.ColIndex = 2 Then colorRow = (e.Style.Text = "red") Else colorRow = (Me.GridDataBoundGrid1(e.RowIndex, 2).Text = "red") End If If colorRow Then e.Style.BackColor = Color.Red End If End If End SubHere is another way you could handle this requirement. Instead of handling QCI, you could handle CurrentCellShowingDropDown. There in this event, you populate the dropdownlist at that point. At that point you can dynamically set the datasource for the list that is about to be displayed. Here is a sample
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.
This page will automatically be redirected to the sign-in page in 10 seconds.