Readonly checkbox in Datagrid

A

andrei

Hi Group,

I have a checkbox column in a web datagrid which is related to a "Product in
stock" property.
The grid is in view mode, so the user can't (and shouldn't) change anything
in the grid.

What I need is to show a "ReadOnly" checkbox in the grid, but not a disabled
one (grayed out).
I'm using a template column and the only property I can set is "enabled".

There is no "ReadOnly" attribute like for the <INPUT type=... > HTML
controls

Anyone knows how to do that ?

And I don't want to replace the checkbox with letters or words, like Y/N,
Yes/No, etc. It has to stay a checkbox.

This is the code I use:

<ItemTemplate>
<asp:CheckBox
id=chkInStock
Checked='<%# DataBinder.Eval(Container, "DataItem.InStock") %>'
Runat="server"
Enabled=False > *** to be replaced...***
</asp:CheckBox>
</ItemTemplate>

Many thanks.
Andrei.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top