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

Nullable DateTime? Column

18 Answers 355 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Russell Groover
Top achievements
Rank 1
Russell Groover asked on 06 Feb 2008, 02:12 PM
I searched around the forums and couldn't find any info on how to have a nullable DateTime in a GridViewDateTimeColumn. 

I want the user to be able to null out the date and save it to the DB as null.  There seems to be no way to do this.  The GridViewDateTimeColumn seems to not allow the user to select no date or allow them to remove the date from the cell.

We're binding to business objects that have DateTime? as a property.

Is there a way to do this in the GridView for Winforms?  thanks

18 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 06 Feb 2008, 06:06 PM
Hello Russell,

Thank you for contacting us.

Unfortunately RadGridView does not support writing a null values in a DataTime column. This is a new feature that we plan to implement for the upcoming Q1 2008 release in April.

Do not hesitate to contact us if you have other questions.


All the best,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
renemt
Top achievements
Rank 2
answered on 23 Feb 2009, 09:15 AM
Hi Telerik-Team,

I just want to ask if there is already support for nullable DateTimes in the GridViewDateTimeColumn - and if so how to use it. I want the user to be able to delete dates in a date time column and store DBNull values in the datasource in this case. If there is no nullable support - do you have an idea for a work around?

Regards,
ReneMT
0
Jack
Telerik team
answered on 23 Feb 2009, 01:56 PM
Hello renemt,

Currently, the GridViewDateTimeColumn does not support nullable DateTime values. We will implement the feature in one of our upcoming releases.

To delete a DateTime value, add a GridViewCommandColumn and handle the CommandCellClick event. Consider the following sample:
GridViewCommandColumn column = new GridViewCommandColumn("Delete"""); 
column.DefaultText = "Delete"
column.UseDefaultText = true
this.radGridView1.Columns.Add(column); 
this.radGridView1.CommandCellClick += new CommandCellClickEventHandler(radGridView1_CommandCellClick); 
 
void radGridView1_CommandCellClick(object sender, EventArgs e) 
    GridCommandCellElement cell = (GridCommandCellElement)sender; 
    cell.RowInfo.Cells["DateTime"].Value = null
 

I hope this helps. Should you have any other questions, feel free to ask.

Kind regards,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jon
Top achievements
Rank 1
answered on 30 Jun 2009, 03:45 PM
Was this ever implemented? I'm still getting a textbox when i use a nullable datetime.
0
renemt
Top achievements
Rank 2
answered on 01 Jul 2009, 07:07 AM
Obviously it wasn't (well, it was not announced before April, 2008 ;-) ). I'm still using a work around.
0
Jack
Telerik team
answered on 01 Jul 2009, 09:22 AM
Hi Jon,

This feature is not implemented yet and there is no time to implement the feature for our upcoming Q2 release. However, we will try to add the feature in the first service pack. If you have any other questions, don't hesitate to ask.

All the best,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
renemt
Top achievements
Rank 2
answered on 01 Dec 2009, 07:30 AM
Are there any news about the nullabe DateTime column? The Q3 2009 Release is out now and since the implementation promise for Q1 2008 (see above) more than one year has passed by - and we are still using ugly workarounds which are complicating our code to support the user with nullable dates in the UI.

So - is this feature available or is there an idea when it will be?


Regards,
ReneMT
0
Jon
Top achievements
Rank 1
answered on 01 Dec 2009, 08:12 AM
Check the Q3 build.  It is working for me with a nullable column.
0
Jack
Telerik team
answered on 01 Dec 2009, 08:45 AM
Hi renemt,

You can reset the value in any data cell by using the context menu. You should select the "Clear Value" option. If you have a suggestion on how we can improve our UI in that direction, please share it with us. We will appreciate that and we will take it into consideration when planning our future releases. I am looking forward to your reply.

Greetings,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Arul S V
Top achievements
Rank 1
answered on 15 Mar 2010, 10:38 AM
Hi,

    i'm using telerik Q3 windows radgridview. 
    previously we used .net windows datagridview. in that we used to set nullable property for a gridcolumn.
    now i want to set the nullable property in Rad Grid View too.
    can u help me in doing that with the sample code.
    
Thanks & Regards,
Arul
0
Jack
Telerik team
answered on 17 Mar 2010, 02:45 PM
Hi Arul S V,

There is nothing special when using nullable properties in RadGridView. Just define the desired property as nullable in your business object and RadGridView will do the rest. However, maybe I didn't understand the scenario. If so, please give more detail on what exactly you want to achieve. I will be glad to assist you further.

Greetings,
Jack
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
Garrison
Top achievements
Rank 1
answered on 16 May 2010, 03:00 PM
I'm using RadControls for WinForms Q1 2010 SP1 and I still can't seem to find a way to display a Nullable DateTime in a GridViewDateTimeColumn.  This appears to have been promised back in 2008, but I can't find any documentation on when it was added, and it doesn't seem to be working at this time.  Can you advise me, and the rest of the community, on the status of this issue?
0
Jack
Telerik team
answered on 18 May 2010, 03:59 PM
Hi Garrison,

Yes, this feature is supported by RadGridView. However, the DataTable does not support nullable types. You have to use custom a bussiness object that defines a nullable DateTime property in order to have such column in RadGridView. There is nothing specific when using nullable date columns. Should you have any further questions, please write back.

All the best,
Jack
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
Garrison
Top achievements
Rank 1
answered on 23 May 2010, 06:03 PM
You're absolutely right.  We aren't using DataTables, but are using custom business objects.  The datetime property in question wasn't marked as Nullable.  Sorry for bothering you needlessly.
0
Daniel Booth
Top achievements
Rank 2
answered on 04 Aug 2010, 04:20 PM
We have a column bound to a nullable datetime field.  And it displays those items that are already null as blanks and lets me set dates, but there doesn't seem to be a way for my user to CLEAR a date that they set.  We're using RadControls_WinForms_2009_2_729.
We currently cannot update to a newer version because of the number of items it breaks throughout our project.  So I need a solution for this version.

Thanks!
0
Jack
Telerik team
answered on 04 Aug 2010, 06:36 PM
Hi Daniel Booth,

I understand your concerns. Our policy is to encourage our customers to update their projects to the newest versions, because they address lots of issues and contain new features. So, I can offer you to do the transition to the last version for you, if you want. You have just to send us your project in a new support ticket.

I am looking forward to your reply.

Greetings,
Jack
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
Daniel Booth
Top achievements
Rank 2
answered on 04 Aug 2010, 06:44 PM
Unfortunately, it will be a few months before our schedule will allow enough time to upgrade to the newest controls. But, on a good note, I think one of our developers has found a way to do this without using the right-click option (which isn't very intuitive).  If we are unable to use his solution we'll submit a ticket to see what you can translate for us.

Thanks!
0
Ranjeeth kumar
Top achievements
Rank 1
answered on 27 Aug 2012, 09:33 AM
Thanks Jack...

This Post helped me allot.

Thanking you.

Best Regards:
----------------------
Ranjeeth Kumar Pathi
Tags
GridView
Asked by
Russell Groover
Top achievements
Rank 1
Answers by
Jack
Telerik team
renemt
Top achievements
Rank 2
Jon
Top achievements
Rank 1
Arul S V
Top achievements
Rank 1
Garrison
Top achievements
Rank 1
Daniel Booth
Top achievements
Rank 2
Ranjeeth kumar
Top achievements
Rank 1
Share this question
or