Click here to Skip to main content
15,892,480 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am displaying data in a Gridview. In my data I have a boolean value in a column. While displaying my gridview or populating my gridview I must display that column as checkbox.

Please help me.
Posted
Updated 6-Oct-10 4:31am
v2
Comments
TheyCallMeMrJames 6-Oct-10 10:31am    
Removed txt spk.
TheyCallMeMrJames 6-Oct-10 10:32am    
If you would like to get a response you should include which version of ASP.NET you're working with, and what frameworks you are using, if any.

 
Share this answer
 
<asp:GridView ID="grd" runat="server" AutoGenerateColumns="False" />
<Columns>
<asp:TemplateField HeaderText="Add">
<ItemTemplate>
<asp:CheckBox ID="chkBoolVal" runat="server" Enabled='<%# Eval("BoolVal") %>' />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
<HeaderStyle Width="50px" HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
</asp:GridView>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900