This is a migrated thread and some comments may be shown as answers.

How to create a RadGrid column that accepts nullable dates (e.g. think an optional date) in MM/YY format?

1 Answer 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jgill
Top achievements
Rank 1
jgill asked on 13 Apr 2010, 01:14 AM
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:
  1. 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?
  2. 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!

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 16 Apr 2010, 09:02 AM
Hello Jgill,

I have attached a small sample project demonstrating the desired functionality. Please give it a try and let me know if further assistance is needed.

Regards,
Martin
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
jgill
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or