Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding a record to a dataset
Message
De
11/01/2005 10:16:10
 
 
À
11/01/2005 08:32:00
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
00975570
Message ID:
00976030
Vues:
18
Kevin,

In your checkbox class, you need an Event Handler for the Format event of the Binding:
Binding oBind = new Binding("Checked", MyTable, MyColumn);
oBind.Format += new ConvertEventHandler(this.FormatHandler);

protected virtual void FormatHandler(object sender, ConvertEventArgs e)
{
	if (e.Value == System.DBNull.Value)
		e.Value = false;
}
~~Bonnie

>Bonnie,
>
>>Boolean null columns are only a pain because the checkbox control doesn't handle a null very elegantly. So, you have to have a checkbox subclass that'll handle that.
>
>PMFJI, but do you have any code examples (preferably C#) as to how to implement this?
>
>TIA, Kevin
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