Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CheckBox in a DataGrid
Message
De
17/09/2003 15:05:33
 
 
À
17/09/2003 13:31:48
Information générale
Forum:
ASP.NET
Catégorie:
WebForms
Divers
Thread ID:
00829837
Message ID:
00830037
Vues:
28
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?...

Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform