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
close icon

DataBoundGrid Conditional Cell Formatting

I have a DBG bound to a datset with mutiple columns. Before the grid is displayed to the user I would like to disable my checkbox column (col 5) based on the number values in columns 2 and 3 per row. But I am not sure of the correct place to action this type of code. Would it be best to put it in PrepareViewStyleInfo with a call to the underlying datatable to retrieve the number values or in QueryCellInfo? Any ideas? (vb.net)

1 Reply

AD Administrator Syncfusion Team June 14, 2004 10:44 AM UTC

You should use either PrepareViewStyleInfo or Model.QueryCellInfo to do this.
If e.RowIndex > 0 And e.ColIndex = 5 Then
   If me.Grid(e.RowIndex, 2).Text = "???" And me.Grid(e.RowIndex, 3).Text = "???" Then
      e.Style.Enabled = False
   end If
End If
I would try this code in PrepareViewStyleInfo to see if it works there. If not, then it shoul dwork in Mode.QueryCellInfo. Here is a thread on a similar request. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=15181

Live Chat Icon For mobile
Up arrow icon