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

how to move dataform's button outside of the DataForm maintaining their appearance?

8 Answers 173 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
ajoua taha
Top achievements
Rank 1
ajoua taha asked on 11 Apr 2016, 10:33 AM

Hi,

I want to to move dataform's button (add, edit, delete, navigation, cancel and commit) outside of the DataForm maintaining their appearance , so when I change application's theme from windows8 to windows8touch , the appearance of the buttons change like if it was in the dataform.

thanks

8 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 13 Apr 2016, 01:57 PM
Hello,

These buttons are part of our CollectionNavigator control.

You have two options here:

1. One possible solution is to the template of RadDataForm and place the CollectionNavigator control (which is part of RadDataForm's template) outside of the dataForm. In order to achieve this, I would suggest you use our Implicit Themes mechanism.

2. Another solution is to hide RadDataForm's collection navigator by setting CommandButtonsVisibility property to None. Then you can use a standalone CollectionNavigator and configure it to work with your DataForm. You can check this help article for a reference.


Regards,
Yoan
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
ajoua taha
Top achievements
Rank 1
answered on 20 Apr 2016, 08:29 AM

Hi

thank you for your reply, I tried the 2nd method, I could make a navigator collection, but it can only switch between items of DataForm or delete an item, but can not edit an item, can you please give me an example of how to configure the CollectionNavigato to Work Correctly with the DataForm.

thanks

0
Accepted
Yoan
Telerik team
answered on 20 Apr 2016, 01:55 PM
Hello,

Actually, the information I had provided for the second approach is not enough. Please excuse me for that. The behavior you have is actually the expected one since the regular RadCollectionNavigator executes its commands. For example, the button for editing an item executes RadCollectionNavigatorCommands.BeginEdit command. This is not the case with RadDataForm's collectionNavigator, the same button executes the following command - RadDataFormCommands.BeginEdit. RadDataForm's internal logic depends on this command, so you need to use it. Fortunately, there is an easy way for achieving this -  Customizing RadCollectionNavigator's Commands. I have created a sample project which demonstrates the approach. Please give it a try and let me know how it works for you.

Regards,
Yoan
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
ajoua taha
Top achievements
Rank 1
answered on 25 Apr 2016, 09:44 AM

Hi Yoan,
Thank you for replying, that's exactly what i needed, but I have another question, is it possible to change the location of buttons "commit", "cancel" as I did with the collection navigation?

0
Yoan
Telerik team
answered on 26 Apr 2016, 01:40 PM
Hello,

Yes, but you need to edit RadDataForm's template.  In order to achieve this, I would suggest you use our Implicit Themes mechanism.

Let me know if you need any further assistance.

Regards,
Yoan
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
ajoua taha
Top achievements
Rank 1
answered on 26 Jul 2016, 01:16 PM

Hi, 

when I try to apply a style to commit or cancel button to get them out of DataForm, the buttons disappear,

<telerik:RadDataForm x:Name="DataForm1"  AutoGenerateFields="False"
                                                 CommandButtonsVisibility="Commit,Cancel"
                                                 Loaded="loadedevent" 
                                                 ItemsSource="{Binding Path=Articless, Mode=OneWay}"
                                                 CurrentItem="{Binding CurrentArticles , Mode=TwoWay}"
                                                 EditTemplate="{StaticResource DFTemplate}">

                                    <telerik:RadDataForm.CommitButtonStyle>
                                        <Style TargetType="telerik:RadButton" >
                                            <Setter Property="Width" Value="15"/>
                                        </Style>
                                    </telerik:RadDataForm.CommitButtonStyle>
                                </telerik:RadDataForm>

can you give us a sample code in which these bouttons are outside the DataForm
thank you,

0
ajoua taha
Top achievements
Rank 1
answered on 26 Jul 2016, 01:20 PM

Hi,

when I try to apply a style to commit or cancel button to get them out of DataForm, the buttons disappear,

<telerik:RadDataForm x:Name="DataForm1"  AutoGenerateFields="False"
                     CommandButtonsVisibility="Commit,Cancel"
                     Loaded="loadedevent"
                     ItemsSource="{Binding Path=Articless, Mode=OneWay}"
                     CurrentItem="{Binding CurrentArticles , Mode=TwoWay}"
                     EditTemplate="{StaticResource DFTemplate}">
                     <telerik:RadDataForm.CommitButtonStyle>
                         <Style TargetType="telerik:RadButton" >
                           <Setter Property="Width" Value="15"/>
                         </Style>
                     </telerik:RadDataForm.CommitButtonStyle>
</telerik:RadDataForm>
can you give us an example in which these bouttons are outside the DataForm
thanks

0
Yoan
Telerik team
answered on 27 Jul 2016, 08:39 AM
Hi,

Are you using our Implicit Styles? If yes, you need to base your style like so:
<Style TargetType="telerik:RadButton" BasedOn="{StaticResource RadButtonStyle}">
                           <Setter Property="Width" Value="15"/>
</Style>


Regards,
Yoan
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
DataForm
Asked by
ajoua taha
Top achievements
Rank 1
Answers by
Yoan
Telerik team
ajoua taha
Top achievements
Rank 1
Share this question
or