RESOLVED!! How to display a checkbox in a Datagrid?
How do you make a boolean column appear as a checkbox in a datagrid using VB code behind the pages?
My original code looks like this (generated when I was designing my datagrid using the property pages):
Code:
<asp:BoundColumn DataField="ItemMarkDown" HeaderText="Markdown">
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:BoundColumn>
I then went to my HTML code and replaced it with this:
Code:
<asp:TemplateColumn HeaderText="MarkDown">
<ItemTemplate>
<asp:CheckBox id="ItemMarkDown" runat="server" checked='<%# DataBinder.Eval
(Container.Dataitem, "ItemMarkDown")%>' Enabled=False />
</ItemTemplate>
</asp:TemplateColumn>
I run the page (F5) and it correctly displays the boolean field with a checkbox. However, when I try to click back to "DESIGN" tab, I get an error:
Quote:
Could not open in Design view. Place quotes around a '<% %>' block used as an attribute value or within a <Select> element.
I tried placing quotes but that didn't work.
Is there a way to do this on the vb code page instead of the html page?
Any ideas?
Thanks