Hi,
I have a bound ComboBox that has a DateTime field for the DisplayMember. I
only want the date to show instead of the date and time (always 12:00 AM).
Is it possible to format the DisplayMember property of the ComboBox?
Thanks,
David Adams
Ken Tucker [MVP] - 07 Jul 2004 12:47 GMT
Hi,
You would have to make a ownerdrawn combobox.
Ken
---------------------
> Hi,
>
[quoted text clipped - 6 lines]
>
> David Adams
Jim-M - 07 Jul 2004 18:07 GMT
You didn't state what the datasource was...but if you can override the
ToString method on the datasource to return just the date part, that's
one option. In the past I've also created a duplicate column on the
datasource (in cases where there's not much data and this isn't a
problem) of type String and initialized to the formatted text as I need
it. This works well for SQL Server queries in DataSets.
The Binding object has a Format event where you can tell it how to
format your data by type. Unfortunately it's not of much help for the
ComboBox list portion...
> Hi,
>
[quoted text clipped - 5 lines]
>
> David Adams
David Adams - 07 Jul 2004 22:17 GMT
Thank you all for your suggestions.
David
> You didn't state what the datasource was...but if you can override the
> ToString method on the datasource to return just the date part, that's
[quoted text clipped - 18 lines]
> >
> > David Adams