J
Jim Bancroft
Hi everyone,
I'd like to use ItemTemplates in my DataGrid to display one checkbox per
row. The idea being, if field XYZ of a given DataItem is 1 (it's a binary
field) then mark the checkbox. Otherwise, don't.
Does this look like a good approach to the problem, or are there better ways
that someone can share?
.....
<asp:TemplateColumn>
<ItemTemplate>
<asp:CheckBox runat="server" id="chkAddable"
Checked=<%#DataBinder.Eval(Container.DataItem, "XYZ")/>
</ItemTemplate>
</asp:TemplateColumn>
.....
I'd like to cast that DataBinder.Eval() to a boolean, but I'm not sure how
to do it. I've tried a few (bool) casts but I get syntax errors each time.
Thanks for your advice and help.
-Jim
I'd like to use ItemTemplates in my DataGrid to display one checkbox per
row. The idea being, if field XYZ of a given DataItem is 1 (it's a binary
field) then mark the checkbox. Otherwise, don't.
Does this look like a good approach to the problem, or are there better ways
that someone can share?
.....
<asp:TemplateColumn>
<ItemTemplate>
<asp:CheckBox runat="server" id="chkAddable"
Checked=<%#DataBinder.Eval(Container.DataItem, "XYZ")/>
</ItemTemplate>
</asp:TemplateColumn>
.....
I'd like to cast that DataBinder.Eval() to a boolean, but I'm not sure how
to do it. I've tried a few (bool) casts but I get syntax errors each time.
Thanks for your advice and help.
-Jim