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

How to assign null date column to GridDateTimeColumn in RadGrid?

3 Answers 397 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Siingh
Top achievements
Rank 2
Siingh asked on 30 Jun 2010, 02:04 AM
Hi
I have Radgrid with few GridDateTimeColumn and it is bound to Datetime column from database, and i have null values in datetime column in my database, problem is i have griddatetimecolumn binded to datetime column but it show error if value from database is null

example.
<telerik:GridDateTimeColumn DataField="ApplicationDate" DataType="System.DateTime"    
HeaderText="ApplicationDate" SortExpression="ApplicationDate"   
SelectedDate='<%# Bind( "ApplicationDate" ) %>' UniqueName="ApplicationDate" /> 

now '<%# Bind( "ApplicationDate" ) %>' also contains null value if there is any date in database then there is no problem but if there is null value then it shows error : Sys.WebForms.PageRequestManagerServerErrorException: 


Please help me to resolve this i want to have GridDateTimeColumn in radgrid but with it also accepts null date value.


Kind Regards:
Harinder Singh
McConnell Dowell
Singapore









3 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 02 Jul 2010, 08:04 AM
Hi Siingh,

Try removing: SelectedDate='<%# Bind( "ApplicationDate" ) %>' from the mark-up for the column.

Greetings,
Tsvetoslav
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
0
Siingh
Top achievements
Rank 2
answered on 02 Jul 2010, 08:46 AM
Than how do i bind control?

I need to bind control so i can use inbult editting and adding new rows to datagrid.

if i remove that tag then adding new row will not save any value into ApplicationDate column



Kind Regards:

0
Tsvetoslav
Telerik team
answered on 02 Jul 2010, 12:15 PM
Hi Siingh,

Setting the DataField property of the column is enough to take care of the binding. You should set a Binding expression only if you are using a template column and defining manually the date-time controls. In that case, a binding expression is valid and obligatory, but not when using a GridDataTimeColumn type.

All the best,
Tsvetoslav
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
Siingh
Top achievements
Rank 2
Answers by
Tsvetoslav
Telerik team
Siingh
Top achievements
Rank 2
Share this question
or