473,830 Members | 2,014 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Readonly checkbox in Datagrid

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.InSto ck") %>'
Runat="server"
Enabled=False > *** to be replaced...***
</asp:CheckBox>
</ItemTemplate>

Many thanks.
Andrei.

Nov 17 '05 #1
0 3108

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1872
by: Learning SQL Server | last post by:
Forgive the repost, but this is really troublesome and I hope SOMEONE can shed some light on it. I am trying to update a datarow via in-place editing from a dataset stored in session. When I try to write the new value into the selected row, I always get the following error : Column is read-only. in my UpdateCommand event I have:
3
267
by: Cyril | last post by:
Hi every body, How can i have a readonly checkbox and checkboxlist ? thanks very much.
3
1548
by: ruca | last post by:
Hi, I have two different questions to ask: QUESTION 1: Can I create dinamically a column in a datagrid? How? I have a datagrid that must have 5 columns, but in some very special cases I have to add another column. How can I do this in code? QUESTION 2:
0
923
by: Ben | last post by:
How would you set the Bound column of a datagrid to ReadOnly dynamically? Tried dgList.Columns.ReadOnly = true; but not successful. Thanks, Ben
3
1912
by: simchajoy2000 | last post by:
Hi, I have a datagrid in a VB.NET form with a set number of rows that the user is required to fill out. But I don't want to allow the user to add or delete rows from the datagrid. The only way I have found to do disable this functionality is to set datagrid.ReadOnly or datagrid.Locked equal to true - but when I do this, the user isn't able to change the information in the cells. Is there some way to disable the add/delete row...
1
1061
by: Marco | last post by:
I'm having some a really weird issue with datagrids. Basically they work fine until you update the data while a cell is selected. If you do that then the old selected cell will remain on the screen and be on top of the new data. You can scroll the new data and the old cell will stay in the same position. You can even click on the old cell and move the cursor around in it. Does anyone know why this is happening?
1
5753
by: CR | last post by:
Is there something I am missing? I have a user interface which needs to be the same whether in view, or edit mode, and it contains checkboxes. How can I make my checkboxes readonly, similar to the textbox readonly state? Thanks
3
2312
by: Chubbly Geezer | last post by:
In VB 2005 my toolbox is missing the Datagrid control. I can cut and paste from another app and that's fine, but I cannot add new. Any suggestions please?
0
1050
by: jdbss | last post by:
I'm using an unbound checkbox within a datagrid, listed below, and setting the initial value during page_load based upon some critieria. The problem is when I "Uncheck" a value that was selected/checked during the page_load, the value is represented as checked regardless. <asp:TemplateColumn> <ItemTemplate> <input id="cbSelected" onclick="URow(this)" type="checkbox"
0
9793
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10774
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10491
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5617
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5780
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4411
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3076
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.