I need to be able to have a dropdown date(calendar dropdown) in a grid column. The user has the choice to choose a date or leave it blank. I am not sure how to use the smartdate null ability with the dropdown in the grid. To add the dropdown, I am doing the following:
DataColumn onsetDate = new DataColumn("OnsetDate", typeof(DateTime));dataTable.Columns.Add(onsetDate);
But it doesn't like the DateTime with the SmartDate.
I am using CSLA 1.x. Any help would be appreciated.
SmartDate is specifically designed to allow your object to expose a String property, and a SmartDate field behind that property. Look at Chapter 7 of the 1.0 book for details on how to use it properly.
The reason for exposing the property as type string, is that string allows the user to enter an empty value, while DateTime never does. DateTime is a terrible type for data entry
I'm not sure how to do a dropdown date picker in the grid - it depends on who's grid control you are using and how they handle it. But supporting a picker and a blank entry may be difficult, because so many control vendors follow the DateTime pattern that says the user can't leave the field blank. Lame, but true.
RockfordLhotka:But supporting a picker and a blank entry may be difficult, because so many control vendors follow the DateTime pattern that says the user can't leave the field blank. Lame, but true.
Copyright (c) Marimer LLC