|
-
Aug 2nd, 2005, 10:26 AM
#1
Thread Starter
Hyperactive Member
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.
Last edited by sinha; Aug 4th, 2005 at 03:22 PM.
Thanks.
-
Aug 2nd, 2005, 10:51 AM
#2
Re: Problem with Checkboxes in the DataGrid
Try this...
Code:
checked='<%# Convert.ToBoolean(DataBinder.Eval(Container.DataItem, "status")) %>'
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Aug 2nd, 2005, 11:14 AM
#3
Thread Starter
Hyperactive Member
Re: Problem with Checkboxes in the DataGrid
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|