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

GridViewDataColumn binded with DateTime value

4 Answers 140 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Davide
Top achievements
Rank 1
Davide asked on 06 Jun 2012, 10:34 AM
Hi,
I have a problem with a GridViewDataColumn of a RadGridView binded to a DateTime? value.
I set DataFormatString to "{} {0:d}" and the column displays only date without time, and it is what I want.
The problem is that I am unable to set a null value in the cell pressing the DEL key or Backspace: when I leave the cell, its value is replaced by the previous value.

Have you any suggestion?

Thanks
Davide

4 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 06 Jun 2012, 10:40 AM
Hello Davide,

 If you want to have null dates, then you can use Nullable<DateTime> instead of a DateTime. 

Greetings,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Davide
Top achievements
Rank 1
answered on 06 Jun 2012, 10:48 AM
It's already set as Nullable<DateTime>, which it's the same things as DateTime? (VB notation).

Davide
0
Dimitrina
Telerik team
answered on 06 Jun 2012, 02:55 PM
Hello Davide,

 I have tested and the value was empty after I deleted the date. What is the result if you define the bound property as Nullable(Of DateTime)?
 

Greetings,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Davide
Top achievements
Rank 1
answered on 06 Jun 2012, 03:59 PM
The result is the same: even if I delete the date, when I change cell the empty date is replaced with the previous value (not empty).
Tags
GridView
Asked by
Davide
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Davide
Top achievements
Rank 1
Share this question
or