Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CheckBox in a DataGrid
Message
From
17/09/2003 15:05:33
 
 
To
17/09/2003 13:31:48
General information
Forum:
ASP.NET
Category:
WebForms
Miscellaneous
Thread ID:
00829837
Message ID:
00830037
Views:
26
This message has been marked as the solution to the initial question of the thread.
AFAIK the column will not be shown until you bound it. So you have two options:

1. Add another column in your SELECT statement from the database:
SELECT *, CAST(0 AS BIT) AS CheckColumn FROM SampleDataTable
2. Add column to the datatable after you fill it with data:
Dim col As DataColumn = New DataColumn("CheckColumn", GetType(Boolean))
col.AllowDBNull = False
col.DefaultValue = False
SampleDataSet.Tables("SampleDataTable").Columns.Add(col)
Either way, do not forget to set AllowNull property of the column style to the false, or your checkboxes will switch between Unchecked, Checked and Grayed.

Plamen Ivanov
MCSD .NET Early Achiever and MCAD .NET Charter Member (VB .NET/SQL Server 2000)
MCSD (VB 6.0/SQL Server 2000)

VB (.NET) - what other language do you need in the whole Universe?...

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform