DataFormDataField.ContentTemplate doesn't work in your latest versions, is it a bug?

2 posts, 0 answers
  1. Zhang
    Zhang avatar
    13 posts
    Member since:
    Oct 2013

    Posted 14 Jan 2014 Link to this post

    I found that DataFormDataField.ContentTemplate doesn't work since version "RadControls for WPF Q2 2013",  actually i only have the latest 3 versions. I've tried each one, all the same, just display the default textbox. My code is simple, just copy from your online documentation, as below:
         <Grid x:Name="LayoutRoot" Background="White">
                <Grid.Resources>
                    <DataTemplate x:Key="MyTemplate">
                        <StackPanel Orientation="Horizontal" >
                            <telerik:DataFormDataField>
                                <telerik:DataFormDataField.LabelTemplate>
                                    <DataTemplate>
                                        <Label Foreground="Orange">Title:</Label>
                                    </DataTemplate>
                                </telerik:DataFormDataField.LabelTemplate>
                                <telerik:DataFormDataField.ContentTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <TextBox Text="25" Margin="0,0,10,0" />
                                            <TextBlock Text="years" Foreground="Green" VerticalAlignment="Bottom" />
                                        </StackPanel>
                                    </DataTemplate>
                                </telerik:DataFormDataField.ContentTemplate>
                            </telerik:DataFormDataField>
                        </StackPanel>
                    </DataTemplate>
                </Grid.Resources>
                <telerik:RadDataForm x:Name="DataForm1"
                               AutoGenerateFields="False" 
                               ReadOnlyTemplate="{StaticResource MyTemplate}">
                </telerik:RadDataForm>
            </Grid>

    MOST URGENT, PLEASE ANSWER IT QUICKLY, THANK YOU!!
  2. Zhang
    Zhang avatar
    13 posts
    Member since:
    Oct 2013

    Posted 15 Jan 2014 Link to this post

    It's OK now, I should use DataFormDataField.Content rather than DataFormDataField.ContentTemplate.
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top