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

[Solved] DateTime Column with null values

1 Answer 379 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Krutika
Top achievements
Rank 1
Krutika asked on 19 Feb 2013, 03:55 PM
I have a radgrid with a column of datatype datetime. I have the below formatting:

 If TypeOf e.Column Is GridBoundColumn Then
            Dim column As GridBoundColumn = e.Column

     If e.Column.DataType.ToString() = "System.DateTime" Then
                column.DataFormatString = "{0:MM/dd/yyyy}"
     End If
End If

But some rows have no values(empty values) for that column.
I want to be able to skip formatting for those rows with empty vales / null values.
How do I do it?

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 22 Feb 2013, 01:48 PM
Hello Krutika,

I have created a sample RadGrid web site demonstrate that the DataFormatString property handles the null and empty values of the field. Can you please check out the attached application and let me know if I am missing something out?

Kind regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Krutika
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or