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

GridView Calendar Column

1 Answer 57 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Fransiscus Setiawan
Top achievements
Rank 1
Fransiscus Setiawan asked on 09 Aug 2010, 04:30 AM
Hi,

I have a question related with the GridView Calendar column. How to make sure that we can put an empty string into a data bound column that uses calendar automatically as its input? The problem is when I set it to an empty string, the calendar control automatically throw me the validation error "Input string is not in correct format". Is there any way we can set the calendar column to accept empty string from the front end without doing its built-in validation?

Cheers

Fransiscus

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 11 Aug 2010, 01:08 PM
Hello Fransiscus Setiawan,

You can set your property bound to your column to be of type Nullable. For example, if your column is:

<telerik:RadGridView.Columns>          
    <telerik:GridViewDataColumn DataMemberBinding="{Binding Birthday}" />
</telerik:RadGridView.Columns>

Then the property Birthday should be defined as follows:
private DateTime? birthday;
 
public DateTime? Birthday
{
    get { return this.birthday; }
    set
    {
        if (value != this.birthday)
        {
            this.birthday = value;
            this.OnPropertyChanged("Birthday");
        }
    }
}


 

Kind regards,
Maya
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
GridView
Asked by
Fransiscus Setiawan
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or