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

9 posts, 1 answers
  1. ajoua taha
    ajoua taha avatar
    25 posts
    Member since:
    Feb 2016

    Posted 11 Apr Link to this post

    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

  2. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 13 Apr Link to this post

    Hello,

    These buttons are part of our CollectionNavigator control.

    You have two options here:

    1. One possible solution is to predefine 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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. ajoua taha
    ajoua taha avatar
    25 posts
    Member since:
    Feb 2016

    Posted 20 Apr Link to this post

    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

  5. Answer
    Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 20 Apr Link to this post

    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.
  6. ajoua taha
    ajoua taha avatar
    25 posts
    Member since:
    Feb 2016

    Posted 25 Apr Link to this post

    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?

  7. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 26 Apr Link to this post

    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.
  8. ajoua taha
    ajoua taha avatar
    25 posts
    Member since:
    Feb 2016

    Posted 26 Jul Link to this post

    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,

  9. ajoua taha
    ajoua taha avatar
    25 posts
    Member since:
    Feb 2016

    Posted 26 Jul Link to this post

    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

  10. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 27 Jul Link to this post

    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.
Back to Top
UI for WPF is Visual Studio 2017 Ready