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
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
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
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
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?
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
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,
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
>
thanks
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