On 18 Apr, 13:31, Tommy DN <tommy...@gmail.com> wrote:
> I'm using a datagrid wich uses a dataset.table as datasource.
> One field is a integerfield with 1 and 0
>
> Is there a possibility to bind this with a checkboxfield ( using
> inheritance for example ? ).
> When it's a 0, the checkbox for the cell must be checked and when it's
> a 1 it must be unchecked.
>
> So 0 and 1 should be converted to a boolean.
Suppose your integer field is called "with_sugar" where a 1 means with
sugar and a 0 means without sugar.
The checked property of a databound checkbox control could have the
following binding expression:
checked='<%# (int)Eval("with_sugar") == 1 %>' (host page language C#)
or
checked='<%# Eval("with_sugar") = 1 %>' (host page language VB)
|