GridViewDateTimeColumn

15 posts, 0 answers
  1. Louis
    Louis  avatar
    44 posts
    Member since:
    Sep 2007

    Posted 01 Oct 2007 Link to this post

    Why is the GridViewDateTimeColumn not showing like the raddatetimepicker ?

    How can i put a raddatetimepicker in a column?
  2. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 02 Oct 2007 Link to this post

    Hello Louis ,

    You cannot put a RadDateTimePicker in RadGridView at this moment. The RadDateTimePicker is not a stand alone control - rather, it was developed to be a plug in module for RadCalendar. Once we provide RadDateTimePicker as a separate control with example and documentation, we will include an example of it with RadGridView.

     

    Best wishes,
    Peter
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Lovsten
    Lovsten avatar
    72 posts
    Member since:
    Aug 2007

    Posted 04 Oct 2007 Link to this post

    For your info Louise. The RadDateTimePicker isn't currently a datetimepicker, it's a DatePickerDateTimeShower (no way for the user to edit the time part). See my post under RadCalender. 
  4. Jose Monerto
    Jose Monerto avatar
    5 posts
    Member since:
    Nov 2009

    Posted 12 Jan 2010 Link to this post

    How can quit DatePickerDateTimeShower or how can selecting automatic date without clicking the control DatePickerDateTimeShower

    regards
  5. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 13 Jan 2010 Link to this post

    Hi Jose,

    I am not sure that I understand your question. There is help article in our online help documentation describing how to customize the date time column. In addition you can use GridViewMaskBoxColumn for date time input:

    GridViewMaskBoxColumn maskColumn = new GridViewMaskBoxColumn("Date");
    maskColumn.MaskType = MaskType.DateTime;
    maskColumn.Mask = "d";
    this.radGridView1.Columns.Add(maskColumn);

    I hope this helps. If you need further assistance, please write back and describe the desired behavior in detail.

    Regards,
    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Jose Monerto
    Jose Monerto avatar
    5 posts
    Member since:
    Nov 2009

    Posted 13 Jan 2010 Link to this post

    How Can I disable the DatePickerDateTimeShower control or how can I select automaticly the data without make a click in the control for select the data date without clicking the control DatePickerDateTimeShower
  7. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 15 Jan 2010 Link to this post

    Hi Jose Monerto,

    Just set the ReadOnly property of the column to true if you want to disable the editor. If you want to hide the popup of the editor, please consider the code snippet below:

    void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
    {
        RadDateTimeEditor editor = this.radGridView1.ActiveEditor as RadDateTimeEditor;
        if (editor != null)
        {
            RadDateTimeEditorElement editorElement = editor.EditorElement as RadDateTimeEditorElement;
            editorElement.ShowUpDown = true;
        }
    }

    As to the second part of your question, the user cannot select a date before first clicking in a RadDateTimeEditor (our date time editor). Please describe your scenario in detail and I will be glad to assist you.

    Regards,

    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.
  8. Jose Monerto
    Jose Monerto avatar
    5 posts
    Member since:
    Nov 2009

    Posted 15 Jan 2010 Link to this post

    Well, How I can make to save the value of the raddatatimepicker without make a click, or to select the value of this, doing "TAB" or "ENTER" in the keyboard just  for have a better capture way from the user?

    thk, regards
  9. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 18 Jan 2010 Link to this post

    Hi Jose Monerto,

    You can get the current value of a date time picker by using ActiveEditor.Value property and you can save it by calling EndEdit method. In all cases, you need some interaction from the user to save the value. In RadGridView this happens when you click on a different cell or when you navigate with the keyboard (by using Tab, Left, Right keys for example). The editor saves its value also when pressing the Enter key. If you expect different behavior, please describe it in detail and I will be glad to help.

    Sincerely yours,

    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.
  10. Wojtek Victor
    Wojtek Victor avatar
    5 posts
    Member since:
    Jun 2013

    Posted 08 Feb in reply to Jack Link to this post

    Hi Jack. I'm having issues with the RadDateTimeEditor in my RadGridView. I'm using the UI for WinForm (v.2017.1.117.40). In my RadGridView, I have standard number editors, text only editors and datetime editors that come standard when data filling my radgridview.

    When I start editing my columns, let's say I edit my number column, then I press the TAB key, the value I put in stayed in the column. Same for my text only columns. But when I get to my datetime editor and press TAB (or ENTER), the value disappears. But when I click out, it's saved. I don't have any cell validating event on key press. Can you replicate this problem?

  11. Wojtek Victor
    Wojtek Victor avatar
    5 posts
    Member since:
    Jun 2013

    Posted 08 Feb in reply to Wojtek Victor Link to this post

    Wojtek Victor said:

    Hi Jack. I'm having issues with the RadDateTimeEditor in my RadGridView. I'm using the UI for WinForm (v.2017.1.117.40). In my RadGridView, I have standard number editors, text only editors and datetime editors that come standard when data filling my radgridview.

    When I start editing my columns, let's say I edit my number column, then I press the TAB key, the value I put in stayed in the column. Same for my text only columns. But when I get to my datetime editor and press TAB (or ENTER), the value disappears. But when I click out, it's saved. I don't have any cell validating event on key press. Can you replicate this problem?

    I forgot to mention that this behavior only happens in the "add new row" line of the RadGridView.

  12. Dimitar
    Admin
    Dimitar avatar
    1590 posts

    Posted 09 Feb Link to this post

    Hi Victor,

    I cannot reproduce this locally. I have attached a small video that shows how I am testing this. What else I need to do in order to reproduce it?

    I am looking forward to your reply.

    Regards,
    Dimitar
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  13. Wojtek Victor
    Wojtek Victor avatar
    5 posts
    Member since:
    Jun 2013

    Posted 09 Feb in reply to Dimitar Link to this post

    Thanks for the quick reply. I've narrowed the problem down. I want to change the masktype of the RadDateTimeEditor to FreeFormDateTime. And since I did that, the TAB and ENTER buttons don't work anymore inside that cell. Here's the code I'm using.

    private void FilterableDataGrid_CellEditorInitialized(object sender, GridViewCellEventArgs e)
    {
        var radDateTimeEditor = _filterableDataGrid.ActiveEditor as RadDateTimeEditor;
        if (radDateTimeEditor == null) return;
     
        var radDateTimeEditorElement = (RadDateTimeEditorElement)radDateTimeEditor.EditorElement;
     
        var radDateTimePickerCalendar = radDateTimeEditorElement.GetCurrentBehavior() as RadDateTimePickerCalendar;
        if (radDateTimePickerCalendar == null) return;
     
        var radDateTimePickerElement = radDateTimePickerCalendar.DateTimePickerElement;
        radDateTimePickerElement.Format = DateTimePickerFormat.Custom;
     
        var radMaskedEditBoxElement = radDateTimePickerCalendar.TextBoxElement;
         
        radMaskedEditBoxElement.EnableNullValueInput = true;
        radMaskedEditBoxElement.MaskType = MaskType.FreeFormDateTime;
     
        const string dateFormat = "yyyy-MM-dd";
        if (e.Column.Name.Contains("ValidTo"))
        {
            radDateTimePickerElement.CustomFormat = radMaskedEditBoxElement.Mask = $"{dateFormat} 23:59:59";
        }
        else if (e.Column.Name.Contains("ValidFrom"))
        {
            radDateTimePickerElement.CustomFormat = radMaskedEditBoxElement.Mask = $"{dateFormat} 00:00:00";
        }
        else
        {
            radDateTimePickerElement.CustomFormat = radMaskedEditBoxElement.Mask = $"{dateFormat} HH:mm:ss";
        }
    }

     

    Thank you!

  14. Wojtek Victor
    Wojtek Victor avatar
    5 posts
    Member since:
    Jun 2013

    Posted 09 Feb in reply to Wojtek Victor Link to this post

    Do I have to implement something similar to this, but catching the TAB and ENTER keys instead?

  15. Dimitar
    Admin
    Dimitar avatar
    1590 posts

    Posted 10 Feb Link to this post

    Hello Victor,

    I was able to reproduce this. It is caused by an issue in our implementation, I have logged the issue in our Feedback Portal. I have added a vote for it on your behalf as well. You can track its progress, subscribe for status changes and add your comment to it here. I have also updated your Telerik Points.

    To workaround this you need to create custom editor:
    class Myditor : RadDateTimeEditor
    {
        public override bool IsModified
        {
            get
            {
                return true;
      
            }
        }
    }

    You can use the EditorRequired event to replace the default editor:
    private void RadGridView1_EditorRequired(object sender, EditorRequiredEventArgs e)
    {
        if (e.EditorType == typeof(RadDateTimeEditor))
        {
            e.Editor = new Myditor();
        }
    }

    Should you have any other questions do not hesitate to ask.

    Regards,
    Dimitar
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top