Tuesday, March 23, 2010

Comparison of ig bound Templated Checkbox to boolean BoundDataField


Shows up as text "true" or "false":
<ig:BoundDataField DataFieldName="IsCostSaving" Key="IsCostSaving" width="30px">
<Header Text="Cost Saving" />
</ig:BoundDataField>

Shows up as a checkbox with checked value picked up from bound field:
<ig:TemplateDataField Key="cb1" width="30px">
<Header Text="Cost Saving" />
<ItemTemplate>
<asp:CheckBox ID="cb1" runat="server" Checked='<%# Eval("IsCostSaving") %>' Enabled="false" />
</ItemTemplate>
</ig:TemplateDataField>

2 comments:

  1. thanks for the code snip. I'm wondering if you can also provide an example of how to update the checkbox value to the databse when using the the method?

    Thanks!

    ReplyDelete
  2. I have given the answer as a new post at:
    http://lookinatdotnet.blogspot.com/2010/10/this-is-codebehind-i-use-to-see-which.html

    ReplyDelete