Using RadDateTimePicker with RadDataForm

8 posts, 0 answers
  1. Ron Frick
    Ron Frick avatar
    28 posts
    Member since:
    Nov 2009

    Posted 13 May 2011 Link to this post

    I am using the autogenerated event and the DataFormDateField does not allow for time to be selected.  Is there a way to accomplish this. Can I use a RadDateTimePicker instead of the DataFormDateField ?

    Thanks,

    Ron
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 16 May 2011 Link to this post

    Hello Ron,

     

    You may take a look at the following online help article for further info.


    Kind regards,
    Vanya Pavlova
    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
  3. DevCraft banner
  4. Ron Frick
    Ron Frick avatar
    28 posts
    Member since:
    Nov 2009

    Posted 16 May 2011 Link to this post

    I had a feeling you might lead me to this example. Unfortunately this example does not use the auto generated event.  Its dataform is set to autogen = false and it uses a datatemplate.  Is there a way to accomplish this when using autogenerated fields, and no datatemplates.

    Thanks,

    Ron
  5. Ron Frick
    Ron Frick avatar
    28 posts
    Member since:
    Nov 2009

    Posted 16 May 2011 Link to this post

    Also note that in the provided example it is using the MICROSOFT version of the dataform, and I am using your version.

    Cheers,

    Ron
  6. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 16 May 2011 Link to this post

    Hello Ron,

     

    The approach is applicable to our RadDataForm as well. Furthermore when the fields are auto-generated this form creates its fields automatically based on the type of the corresponding properties. For example the RadDateTimePicker will be automatically added if the type of the underlying property is DateTime. 
    You may also refer to our online documentation for further info. 


    Best wishes,
    Vanya Pavlova
    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
  7. Ron Frick
    Ron Frick avatar
    28 posts
    Member since:
    Nov 2009

    Posted 16 May 2011 Link to this post

    I must be doing something wrong because I have datetime field that gets autogenerated as a datepicker...not a datetimepicker. Is there something I need to do in the metadata of my object?

    Thanks,

    Ron
  8. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 19 May 2011 Link to this post

    Hello Ron Frick,

    There seems to be some misunderstanding here.
    To avoid further confusion I am attaching a small sample. There is some code in the autogenerating event , to replace the DatePicker with DateTimePicker.

    Please find the project attached and receive my apologies for the confusion.

    All the best,
    Pavel Pavlov
    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
  9. Ron Frick
    Ron Frick avatar
    28 posts
    Member since:
    Nov 2009

    Posted 19 May 2011 Link to this post

    Awesome!!!  I had to tweek the code you sent me but it got the point across and I was able to get it to work with this code...
    Once again thank you.  I really appreciate all the work you are doing to the dataform. It is an fantastic tool.

    if (e.PropertyName == "Date")
      {
          var picker = new RadDateTimePicker();
          e.DataField.Label = "Date of service";
          e.DataField.DataMemberBinding = new Binding("Date");
          e.DataField.DataMemberBinding.Mode = BindingMode.TwoWay;
          if (e.DataField.DataMemberBinding != null)
          {
              picker.SetBinding(RadDateTimePicker.SelectedValueProperty, e.DataField.DataMemberBinding);
          }
          e.DataField.Content = picker;
      }
Back to Top
DevCraft banner