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):
I then went to my HTML code and replaced it with this:Code:<asp:BoundColumn DataField="ItemMarkDown" HeaderText="Markdown"> <ItemStyle HorizontalAlign="Center"></ItemStyle> </asp:BoundColumn>
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:Code:<asp:TemplateColumn HeaderText="MarkDown"> <ItemTemplate> <asp:CheckBox id="ItemMarkDown" runat="server" checked='<%# DataBinder.Eval (Container.Dataitem, "ItemMarkDown")%>' Enabled=False /> </ItemTemplate> </asp:TemplateColumn>
I tried placing quotes but that didn't work.Could not open in Design view. Place quotes around a '<% %>' block used as an attribute value or within a <Select> element.
Is there a way to do this on the vb code page instead of the html page?
Any ideas?
Thanks




Reply With Quote