Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bound checkbox in a DataGrid
Message
From
15/10/2008 05:06:55
 
 
To
14/10/2008 13:38:24
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01354896
Message ID:
01355065
Views:
18
>I guess I haven't tried to do this before. I would like to display a boolean field in a data grid with a checkbox. I added a checkbox type column to the grid and bound it to a boolean field but it just shows up as dimmed out. What is the process for doing this?
>

well, checkbox type columns show up as dimmed out (in other words: disabled or readonly) like any other column in the grid
If you want it to be enabled, you need to "Edit" that particular row!
As an alternative, you can create a template column with a bound checkbox inside. In this case, all checkboxes in this columns show up as enabled, but you have to care about saving the checked status changings on your own.

>How about if I want to display an enumeratin value that corresponds to an integer in the data within a datagrid? So if I have a type column that can be a 0, 1, or 2 value but I want to display in the datagrid "Message", "Tip", "Location".

if you simply want to display these values, you can (again) create a template column with no control inside.
In the RowDataBound event of the gridview, you can modify the "Text" property of the "cell" in that particular column.

HTH
Holger Vorberg
Germany
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform