Using MS Datagrid and Ingragistics Calendar pulldown and Combobox's


Author
Message
Robert Carl Johnson
Robert Carl Johnson
StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)
Group: Forum Members
Posts: 48, Visits: 130
Hi all. I've seen this done but I just can't remember how. My grid is displaying a datetime from the database, how can I get it to just display only the date and not the time. A setting in the BO mapper?



Also I'm using the UltraCalendarComboColumn and I set the default date to DT. Which sets the default date to 01/01/1800.. pretty useless. So, I put the following code in the RowEnter event which should if the calendar does not have a date already set from the database, use the following code to set the date... but it didn't. No error was thrown either.. sigh... any ideas?





'--Set default date for pulldown calendar.

Try

Me.StatusDateDataGridViewTextBoxColumn1.DefaultNewRowValue = Today()

Catch ex As Exception

System.Windows.Forms.MessageBox.Show(ex.ToString)

End Try



Regards from a poor .net newbie...



Robert
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
A setting in the BO mapper?

No.  Unless you create a custom property to return the value you want.  It depends on where and when you are displaying a date value.  You can just use teh native .NET formatting to specify what to show.  For example, if you have a date field and want to show only the short date format....and not rely on the Short Date settings on the OS (a good idea for consistency at times) you can just use the MM/dd/yyyy.

MsgBox(String.Format({0:MM/dd/yyyy},DateTime.Now))

Anywhere that you use the formatting in SF this way (i.e. Lists, ListView,  and Combos) you can supply the formatting like above.

For example, a column ina ListView:

{0:MM/dd/yyyy}

Robert Carl Johnson
Robert Carl Johnson
StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)StrataFrame Novice (50 reputation)
Group: Forum Members
Posts: 48, Visits: 130
Thanks Trent.



Robert
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search