Hi Clay,
Received your tip got working partly.
With this i can only check for a particular column upon receiving focus on that column.
so first time, i recv the focus to the disabled cell.
this i want to avoid.
How can i go with?
regards
Rajaraman
>You cannot use an indexer to set style properties (other than Text and CellValue) on an individual cell in a GridDataBoundGrid. The reason is that there are style properties saved for individual cells in a GridDataBoundGrid. The only 'storage' in a GriddataBoundGrid is the DataSource which only holds the values (hence why you can use indexers to save the Text/CellValue property).
>
> You can use indexers to save style properties for a GridControl, but not a GridDataBoundGrid.
>
> If you want to make a particular cell have a particular style property in a GridDataBoundGrid, then you should handle the Model.QueryCellInfo event. In your event handler, depending upon the value of e.ColIndex and e.RowIndex (and whatever other condition you want to use), you set the e.Style property accordingly.
>
> Here is a snippet that colors a row red if the value in column two on the row is 'red'.
>
>
> '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 Sub
>