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

Using RadDateTimePicker with RadDataForm

7 Answers 159 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Ron Frick
Top achievements
Rank 2
Ron Frick asked on 13 May 2011, 06:03 PM
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

7 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 16 May 2011, 07:47 AM
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
0
Ron Frick
Top achievements
Rank 2
answered on 16 May 2011, 07:51 AM
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
0
Ron Frick
Top achievements
Rank 2
answered on 16 May 2011, 07:53 AM
Also note that in the provided example it is using the MICROSOFT version of the dataform, and I am using your version.

Cheers,

Ron
0
Vanya Pavlova
Telerik team
answered on 16 May 2011, 08:00 AM
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
0
Ron Frick
Top achievements
Rank 2
answered on 16 May 2011, 03:39 PM
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
0
Pavel Pavlov
Telerik team
answered on 19 May 2011, 12:57 PM
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
0
Ron Frick
Top achievements
Rank 2
answered on 19 May 2011, 05:25 PM

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;
  }
Tags
DataForm
Asked by
Ron Frick
Top achievements
Rank 2
Answers by
Vanya Pavlova
Telerik team
Ron Frick
Top achievements
Rank 2
Pavel Pavlov
Telerik team
Share this question
or