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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DataBoundGrid Conditional Cell Formatting

Thread ID:





15189 Jun 14,2004 09:55 AM UTC Jun 14,2004 10:44 AM UTC WinForms 1
Tags: GridControl
Administrator [Syncfusion]
Asked On June 14, 2004 09:55 AM UTC

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)

Administrator [Syncfusion]
Replied On 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


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon