Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
555
CheckBox cell style in databound grid.
posted

Hi.

My question is - when I data bind grid to data source, boolean data will be interpreted as checkbox, i.e. true will cause the checkbox to be checked , and false will cause the checkbox to be unchecked. The question is - is there a data type which corresponds tri-state check box (i.e. checked, unchecked, disabled) and can control all of its states, or do I need to use boolean field and control disabled state via some other variable and AllowEdit property?

Parents
No Data
Reply
  • 37774
    posted

    I think that a nullable boolean should work for this ("bool?" or Nullable<bool>).  In some cases, the data source will allow DBNull.Value as well, in which case you could use a TriStateCheckBox as the column's Style.

    -Matt

Children