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

Change Dataform from AddNew Mode to ReadOnly

1 Answer 65 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
peter
Top achievements
Rank 1
peter asked on 12 Sep 2012, 06:05 AM
Hi i have a raddataform which is linked to my ragdgridview, i click on my add button which brings up a RadDataForm in the AddNew mode, i then click on a Row in my radgridview, what i want is for this row to now display in ReadOnlyMode in my dataform, instead it displays in the edit mode. How do i go about solving this, thanks

1 Answer, 1 is accepted

Sort by
0
Almond
Top achievements
Rank 1
answered on 12 Sep 2012, 07:53 AM
Hello Peter,

Could you please show us your XML code?

I have successfully implemented such by just having the ItemSource of the RadDataForm pointing to the same RadDomainDataSource being used by RadGridview. Something like the code below:

ItemsSource="{Binding DataView, ElementName=myDS}"

Then added this code as well:
CurrentItem="{Binding}"

Also, would just like to ask if you are clicking the RadGridView in EditMode as you have stated below? If so, I do believe that since its pointing to the same DataSource, the RadDataForm will automatically change the data in your form since you are currently in EditMode.  Try finishing/cancelling the Add/Edit mode first and then select a row in the RadGridView, the form should show your row as ReadOnly.  If it doesn't work, you might to try and implement DataTemplates for your RadDataForm.

Hope this helps. 

almond
Tags
DataForm
Asked by
peter
Top achievements
Rank 1
Answers by
Almond
Top achievements
Rank 1
Share this question
or