PC Review


Reply
Thread Tools Rate Thread

Binding nullable value to combobox

 
 
Bob Rundle
Guest
Posts: n/a
 
      25th Aug 2004
I'm binding a ComboBox to a field in a DataRow. I am loading the combobox
with values from an Enum. I am building to the "SelectedItem" property.
Everything works find except that I want to display (None) in the combo box
when the field is null. Is there a way to do this? I tried setting the
default value in the XML Schema, but this did not help.

Regards,
Bob Rundle



 
Reply With Quote
 
 
 
 
Miha Markic [MVP C#]
Guest
Posts: n/a
 
      25th Aug 2004
Hi Bob,

AFAIK is not possible out of the box.
You could use custom drawing probably or use some 3rd party control.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"Bob Rundle" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm binding a ComboBox to a field in a DataRow. I am loading the combobox
> with values from an Enum. I am building to the "SelectedItem" property.
> Everything works find except that I want to display (None) in the combo
> box
> when the field is null. Is there a way to do this? I tried setting the
> default value in the XML Schema, but this did not help.
>
> Regards,
> Bob Rundle
>
>
>



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      25th Aug 2004
Bob,

Have a look at this
binding format event
http://msdn.microsoft.com/library/de...ormattopic.asp

and this when you want to do it the other way back
binding parse event
http://msdn.microsoft.com/library/de...parsetopic.asp

I hope this helps?

Cor

gbl...
> I'm binding a ComboBox to a field in a DataRow. I am loading the combobox
> with values from an Enum. I am building to the "SelectedItem" property.
> Everything works find except that I want to display (None) in the combo

box
> when the field is null. Is there a way to do this? I tried setting the
> default value in the XML Schema, but this did not help.
>
> Regards,
> Bob Rundle
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
help: datetimepicker nullable required with binding support Alcibiade Microsoft C# .NET 0 21st Sep 2010 10:38 AM
Binding three state checkbox to nullable boolean klachemin@comcast.net Microsoft VB .NET 2 22nd Mar 2008 10:44 PM
Binding to Nullable(Of T) properties Jack Jackson Microsoft Dot NET Framework Forms 9 7th Feb 2008 06:36 AM
binding nullable property Marka83 Microsoft Dot NET Framework Forms 1 20th Dec 2007 07:08 AM
Combobox and Nullable Enum Brian Microsoft C# .NET 1 13th Jun 2006 11:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:54 AM.