Nullable DateTime? Column

19 posts, 0 answers
  1. Russell Groover
    Russell Groover avatar
    9 posts
    Member since:
    Dec 2007

    Posted 06 Feb 2008 Link to this post

    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
  2. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 06 Feb 2008 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. renemt
    renemt avatar
    40 posts
    Member since:
    Jul 2007

    Posted 23 Feb 2009 Link to this post

    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
  5. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 23 Feb 2009 Link to this post

    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.
  6. Jon Masters
    Jon Masters avatar
    35 posts
    Member since:
    Jan 2009

    Posted 30 Jun 2009 Link to this post

    Was this ever implemented? I'm still getting a textbox when i use a nullable datetime.
  7. renemt
    renemt avatar
    40 posts
    Member since:
    Jul 2007

    Posted 01 Jul 2009 Link to this post

    Obviously it wasn't (well, it was not announced before April, 2008 ;-) ). I'm still using a work around.
  8. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 01 Jul 2009 Link to this post

    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.
  9. renemt
    renemt avatar
    40 posts
    Member since:
    Jul 2007

    Posted 01 Dec 2009 Link to this post

    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
  10. Jon Masters
    Jon Masters avatar
    35 posts
    Member since:
    Jan 2009

    Posted 01 Dec 2009 Link to this post

    Check the Q3 build.  It is working for me with a nullable column.
  11. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 01 Dec 2009 Link to this post

    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.
  12. Arul S V
    Arul S V avatar
    21 posts
    Member since:
    Mar 2010

    Posted 15 Mar 2010 Link to this post

    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
  13. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 17 Mar 2010 Link to this post

    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.
  14. Garrison
    Garrison avatar
    10 posts
    Member since:
    Apr 2008

    Posted 16 May 2010 Link to this post

    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?
  15. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 18 May 2010 Link to this post

    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.
  16. Garrison
    Garrison avatar
    10 posts
    Member since:
    Apr 2008

    Posted 23 May 2010 Link to this post

    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.
  17. Daniel Booth
    Daniel Booth avatar
    4 posts
    Member since:
    Apr 2008

    Posted 04 Aug 2010 Link to this post

    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!
  18. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 04 Aug 2010 Link to this post

    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
  19. Daniel Booth
    Daniel Booth avatar
    4 posts
    Member since:
    Apr 2008

    Posted 04 Aug 2010 Link to this post

    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!
  20. Ranjeeth kumar
    Ranjeeth kumar avatar
    1 posts
    Member since:
    Aug 2012

    Posted 27 Aug 2012 Link to this post

    Thanks Jack...

    This Post helped me allot.

    Thanking you.

    Best Regards:
    ----------------------
    Ranjeeth Kumar Pathi
Back to Top
UI for WinForms is Visual Studio 2017 Ready