Listbox DisplayMember and DateTime Format

H

Hoffmania

Hello,

I am binding a DataSet to a listbox. This listbox is used to set the
current binding for an appointment page. A problem I have is that there
can only be one appointment per day and I would like the listbox to
only display the Date and not the Time. In otherwords, I want the
DisplayMember to call ToShortDateString() rather than ToStirng(). Or,
could I apply a formater or a format event to this basic binding.

Any help would be appreciated.
 
T

Truong Hong Thi

One possible way you could try is the make the value a string rather
than DateTime. For example you could modify the SQL to convert date to
appropriate string before filling the dataset, or you could manipulate
the dataset itself.

Thi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top