Depending on your data, you might be able to use an IIF statement inline to
indicate whether the checkbox is checked:
<asp:DataGrid id="DataGrid1" runat="server">
<Columns>
<asp:TemplateColumn HeaderText="Boolean Value">
<ItemTemplate>
<asp:CheckBox id=match runat="server" onCheckedChanged="updateStatus"
Checked='<%# DataBinder.Eval(Container, "DataItem.Boolean") %>'
AutoPostBack="True">
</asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Boolean Value">
<ItemTemplate>
<asp:CheckBox id="Checkbox1" runat="server"
onCheckedChanged="updateStatus" Checked='<%# IIF(DataBinder.Eval(Container,
"DataItem.Boolean"),"true","false") %>' AutoPostBack="True">
</asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Boolean Value">
<ItemTemplate>
<asp:Label id="Label1" runat="server"><%#
IIF(DataBinder.Eval(Container, "DataItem.Boolean"),"Yes","No")
%></asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
Ken
MVP [ASP.NET]
"Asha" <As**@discussions.microsoft.com> wrote in message
news:7F**********************************@microsof t.com...
greetings,
i'm loading a datagrid and my gird has checkbox, i want these checkboxex
to
be check based on the value from the db? can someone please show me the
code
for it? thanks