Good morning,
I have some problems while trying to display a datetime value in the grid.
I use a list of items (BindingList<items>) that is bound to the grid. No problem so far, everything works as expected.
The grid displays the datetime value as date, which seems to be the default behavior.I read in one of the posts that the following formatting condition can be used to display date and time:
{date} {time}
So far, so good. When I apply this condition to the column the correct mask is shown in the designer:__.__.____ __:__:__
Unfortunately when I start the application I get the date and time, but without any formatting at all:30032010092344
Could anybody please be so kind and tell me how to accomplish to display the datetime as mentioned?
Any help is kindly appreciated
best regards
Andy
Hi Andy,
I'm a little fuzzy on what the question is. You say you are are getting the correct mask, but then you say you are not getting the correct mask? I assume you mean the mask is not showing up initially? When does it correct itself? In what event are you setting the MaskInput on the column? Ideally, you should be using the InitializeLayout event of the grid for this.
Hi Mike,
good to hear from you ;)
Sorry if I couldn't explain the problem straight, let me try to clarify it a little bit.
I set the MaskInput of the column to {date} {time}in the "UltraGridDesigner".
After that I get the following displayed in the "Visual Studio Designer":__.__.____ __:__:__
This is when I mentioned "I get the right mask displayed" (in "VS Designer")So the mask looks perfect, just what I expected.
The grid was bound to a BindingList<MyItem> using the "UltraGrid Designer" (Object DataSource).
When I start the application a new BindingList<MyItem> is attached as datasource to the grid and the data is loaded as expected. It is only the DateTime column (with the MaskInput) that shows the date without any formatting, just the numbers of day, month, year, hour, minute, second like that:03032010094500I expected it to be:03.03.2010 09:45:00
I also tried the "Format" property in the meantime, but somehow I just do not succeed.
Thanks a lot for looking into this Mike, I really appreciate your help.