How to populate checkboxes in a grid control?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In grdReport_ItemDataBound event how could I populate the checkbox column
according to another hidden column value? Thanks!

awan
 
this works for me
where raised is either 1 or 0 in the dataset

NB you may need to turn off autogenerate columns on the grid

<asp:TemplateColumn SortExpression="Raised" HeaderText="Raised">
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<asp:CheckBox id="chkRaised" runat="server" Enabled="False" Checked='<%#
DataBinder.Eval(Container.DataItem, "raised") %>' >
</asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>
 
Back
Top