Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding a record to a dataset
Message
From
11/01/2005 10:16:10
 
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
00975570
Message ID:
00976030
Views:
19
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform