I created a datagrid and template column binding the data to a checkbox. Unfortunately, the checkbox can be checked/unchecked at will. While it does not modify the underlying data (AFAIK), it is annoying to know that users can modify it.
The checkbox is based off of this FAQ:
here is the actual code I use:
I tried to set Enabled to False but it's such a light grey it is barely noticable. Is there a way to prevent editing (even through event handlers maybe?)
The checkbox is based off of this FAQ:
here is the actual code I use:
Code:
<asp:TemplateColumn HeaderText="Status">
<HeaderStyle Width="50px"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<asp:CheckBox Enabled =True Checked='<%# DataBinder.Eval(Container.DataItem, "Status") %> '
Text = ''
runat="server"/>
</ItemTemplate>
</asp:TemplateColumn>
I tried to set Enabled to False but it's such a light grey it is barely noticable. Is there a way to prevent editing (even through event handlers maybe?)