Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I get rid of the third Checkbox state on a datagr
Message
De
27/01/2004 12:29:30
 
Information générale
Forum:
ASP.NET
Catégorie:
WebForms
Divers
Thread ID:
00871007
Message ID:
00871029
Vues:
18
For CheckBoxes in a DataGrid, John's suggestion is your only option ... at least as far as I know. For CheckBoxes not in a DataGrid, you can handle the FormatHandler event to change the CheckBox value to false when the underlying data is DBNull.

~~Bonnie


>I have the following code for setting up one of the columns for a datagrid:
>
>Dim OtherCorrespondenceCol As New DataGridBoolColumn
>OtherCorrespondenceCol.MappingName = "OtherCorrespondence"
>OtherCorrespondenceCol.HeaderText = "Other " & ControlChars.CrLf & "Correspondence"
>OtherCorrespondenceCol.Width = 95
>OtherCorrespondenceCol.AllowNull = False
>OtherCorrespondenceCol.FalseValue = False
>OtherCorrespondenceCol.TrueValue = True
>gridStyle.GridColumnStyles.Add(OtherCorrespondenceCol)
>
>The grid loads fine with existing information. However, when I click on the grid to add a new row, the default value for the checkbox is the greyed out state ("third state"). I want it to default to be not selected (False/0).
>
>What am I missing to make it so the "third state" is not an option? Once I select the checkbox on datagrid, it never allows you to go back to the "third state". Once you have selected it, you can only alternate between checked and unchecked.
>
>Thanks,
>
>Vic
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform