Problem with Checkboxes in the DataGrid <Resolved>
Hi!
I am working on an Asp.net application with c# as the code behind. A newbie.
I have a datagrid, in which I am showing checkbox (bound to a column of my table).
My code is
Code:
<asp:CheckBox id="chkActive" enabled= "false" AutoPostBack="True" Runat="server" checked='<%# DataBinder.Eval(Container.DataItem, "status") %>'>
</asp:CheckBox>
The datatype of the 'Status' field in the database is bit. ( I am using Sql Server 2000). It works perfectly fine.
But, due to some reason, when I change the datatype of the Status field to int, it doesn't work. How to implement checboxes in the grid, when the datatype is int.
Pls help.
Thanks.
Re: Problem with Checkboxes in the DataGrid
Try this...
Code:
checked='<%# Convert.ToBoolean(DataBinder.Eval(Container.DataItem, "status")) %>'
Re: Problem with Checkboxes in the DataGrid