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

RadDateTimePicker not abiding by RadDataForm.Mode

4 Answers 74 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 17 Dec 2012, 09:35 PM
I have a RadDataForm that contains a number of fields.

When I add a DataFormDateField and bring up the form in ReadOnly mode, the field is disabled.  When I add a DataFormDataField that contains a RadDateTimePickerand bring up the form in ReadOnly mode, the field is not disabled.

In other words, this works:
<telerik:DataFormDateField
    Label="Contact Date"
    DataMemberBinding="{Binding Path=contactdt}"
    />

And this does not:
<telerik:DataFormDataField
    Label="Contact Date"
    >
    <telerik:RadDateTimePicker
        SelectedValue="{Binding Path=contactdt}"
    />
</telerik:DataFormDataField>

Is there a way to get a DataFormDataFields contained controls to respond to the form's Mode?

4 Answers, 1 is accepted

Sort by
0
Accepted
Maya
Telerik team
answered on 18 Dec 2012, 12:29 PM
Hello Jeffrey,

You can try binding IsReadOnly property of RadDateTimePicker to a property in your ViewModel for example and update its value (true/ false) on BeginningEdit and EditEnded events.  

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Jeff
Top achievements
Rank 1
answered on 18 Dec 2012, 09:54 PM
That will work.  I was just hoping for something less verbose.
0
Maya
Telerik team
answered on 24 Dec 2012, 08:14 AM
Hi Jeffrey,

Just as a quick follow-up, another possible way to go (if appropriate) would be to define editing control as follows:

<telerik:RadDateTimePicker SelectedDate="{Binding Established}"
                                                   IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource AncestorType=telerik:DataFormDataField}}"/>


Greetings,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Jeff
Top achievements
Rank 1
answered on 27 Dec 2012, 03:27 PM
Clever.
Tags
DataForm
Asked by
Jeff
Top achievements
Rank 1
Answers by
Maya
Telerik team
Jeff
Top achievements
Rank 1
Share this question
or