Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web App: wishes Template Column Checkbox was read only

Status
Not open for further replies.

CrashDome

Technical User
Jan 7, 2002
86
US
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:
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?)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top