Hello,
I have successfully created a grid and it's columns in the code behind and everything is working swimmingly, however now I need to support nullable dates in the pop-up grid editor. For example: Start date is required while end date is optional and often will not be populated. Currently if you edit the grid or want to insert a new record and do not specify a value for the end date, technically the pop-up editor thinks some kind of invalid datetime exception occured.
Now that i have provided the backup, I have two questions that I hope you can help to answer:
I have successfully created a grid and it's columns in the code behind and everything is working swimmingly, however now I need to support nullable dates in the pop-up grid editor. For example: Start date is required while end date is optional and often will not be populated. Currently if you edit the grid or want to insert a new record and do not specify a value for the end date, technically the pop-up editor thinks some kind of invalid datetime exception occured.
Now that i have provided the backup, I have two questions that I hope you can help to answer:
- How can you create a grid column programatically that accepts null for date values (System.Date...does not work for this) when in edit/insert mode?
- How can you use a built-in column editor for date values but have this values formatted as MM/YY when the column is defined programmatically ({0:d} works for 4/1/2010 but {0:MM/yy} in the dataformat for the column does not seem to work)?
Thank you!