DataFormField vary in size

3 posts, 0 answers
  1. Alan
    Alan avatar
    107 posts
    Member since:
    Oct 2010

    Posted 14 Jan 2015 Link to this post

    Hi,

    I have a RadDataForm using Windows8Theme (although the theme doesn't seem to matter) with the following definition:

    <telerik:RadDataForm x:Name="radUserForm" Grid.Row="0" AutoGenerateFields="False" ItemsSource="{Binding Path=UsersList}">
                <telerik:RadDataForm.ReadOnlyTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <telerik:DataFormDataField DataMemberBinding="{Binding AD_Username, Mode=OneWay}" Label="AD Username" IsEnabled="False" >
                                <telerik:DataFormDataField.Content>
                                    <telerik:RadComboBox ItemsSource="{Binding Source={StaticResource ResourceKey=SysUsersList}}"
                                                         DisplayMemberPath="USER_NAME" SelectedValuePath="USER_ID" SelectedValue="{Binding AD_Username}"
                                                         IsEnabled="False"/>
                                </telerik:DataFormDataField.Content>
                            </telerik:DataFormDataField>
     
                            <telerik:DataFormDataField DataMemberBinding="{Binding Username, Mode=OneWay}" Label="Username" IsEnabled="False" />
                            <telerik:DataFormDataField DataMemberBinding="{Binding Email, Mode=OneWay}" Label="E-Mail" IsEnabled="False" />
                            <telerik:DataFormDataField DataMemberBinding="{Binding ProfileId, Mode=OneWay}" Label="Profile" IsEnabled="False">
                                <telerik:DataFormDataField.Content>
                                    <telerik:RadComboBox ItemsSource="{Binding Source={StaticResource ResourceKey=ProfilesList}}" 
                                                         DisplayMemberPath="ProfileName" SelectedValuePath="Id"
                                                         SelectedValue="{Binding ProfileId}" IsEnabled="False" />
                                </telerik:DataFormDataField.Content>
                            </telerik:DataFormDataField>
                        </StackPanel>
                    </DataTemplate>
                </telerik:RadDataForm.ReadOnlyTemplate>
                <telerik:RadDataForm.EditTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <telerik:DataFormDataField DataMemberBinding="{Binding AD_Username, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Label="AD Username" IsEnabled="True" >
                                <telerik:DataFormDataField.Content>
                                    <telerik:RadComboBox ItemsSource="{Binding Source={StaticResource ResourceKey=SysUsersList}}"
                                                         DisplayMemberPath="USER_NAME" SelectedValuePath="USER_ID" SelectedValue="{Binding AD_Username}"
                                                         IsEnabled="True"/>
                                </telerik:DataFormDataField.Content>
                            </telerik:DataFormDataField>
     
                            <telerik:DataFormDataField  Label="Username" IsEnabled="True"
                                                        DataMemberBinding="{Binding Username, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}" />
                            <telerik:DataFormDataField  Label="E-Mail" IsEnabled="True"
                                                        DataMemberBinding="{Binding Email, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged,  ValidatesOnNotifyDataErrors=True}" />
                            <telerik:DataFormDataField DataMemberBinding="{Binding ProfileId, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged,
                                ValidatesOnNotifyDataErrors=True, NotifyOnValidationError=True}" Label="Profile" IsEnabled="True" >
                                <telerik:DataFormDataField.Content>
                                    <telerik:RadComboBox ItemsSource="{Binding Source={StaticResource ResourceKey=ProfilesList}}"
                                                         DisplayMemberPath="ProfileName" SelectedValuePath="Id"
                                                         SelectedValue="{Binding ProfileId}" IsEnabled="True" />
                                </telerik:DataFormDataField.Content>
                            </telerik:DataFormDataField>
                            <telerik:DataFormDataField  Label="Password">
                                <PasswordBox MaxLength="50" controls:PasswordBoxAssistant.BindPassword="True"
                                             controls:PasswordBoxAssistant.BoundPassword="{Binding Path=PasswordString, Mode=TwoWay,
                                            UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}" />
                            </telerik:DataFormDataField>
                        </StackPanel>
                    </DataTemplate>
                </telerik:RadDataForm.EditTemplate>
                <telerik:RadDataForm.NewItemTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <telerik:DataFormDataField DataMemberBinding="{Binding AD_Username, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Label="AD Username" IsEnabled="True" >
                                <telerik:DataFormDataField.Content>
                                    <telerik:RadComboBox ItemsSource="{Binding Source={StaticResource ResourceKey=SysUsersList}}"
                                                         DisplayMemberPath="USER_NAME" SelectedValuePath="USER_ID" SelectedValue="{Binding AD_Username}"
                                                         IsEnabled="True"/>
                                </telerik:DataFormDataField.Content>
                            </telerik:DataFormDataField>
     
                            <telerik:DataFormDataField  Label="Username" IsEnabled="True"
                                                        DataMemberBinding="{Binding Username, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}" />
                            <telerik:DataFormDataField  Label="E-Mail" IsEnabled="True"
                                                        DataMemberBinding="{Binding Email, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged,  ValidatesOnNotifyDataErrors=True}" />
                            <telerik:DataFormDataField  Label="Password">
                                <PasswordBox MaxLength="50" controls:PasswordBoxAssistant.BindPassword="True"
                                             controls:PasswordBoxAssistant.BoundPassword="{Binding Path=PasswordString, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged,
                                     ValidatesOnNotifyDataErrors=True, NotifyOnValidationError=True}" />
                            </telerik:DataFormDataField>
     
                            <telerik:DataFormDataField DataMemberBinding="{Binding ProfileId, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged,
                                ValidatesOnNotifyDataErrors=True, NotifyOnValidationError=True}"
                                                       Label="Profile" IsEnabled="True" >
                                <telerik:DataFormDataField.Content>
                                    <telerik:RadComboBox ItemsSource="{Binding Source={StaticResource ResourceKey=ProfilesList}}"
                                                         DisplayMemberPath="ProfileName" SelectedValuePath="Id"
                                                         SelectedValue="{Binding ProfileId}" IsEnabled="True" />
                                </telerik:DataFormDataField.Content>
                            </telerik:DataFormDataField>
                        </StackPanel>
                    </DataTemplate>
                </telerik:RadDataForm.NewItemTemplate>
            </telerik:RadDataForm>


    The result is the attached image. Notice how username and e-mail fields are of a different size than the other field.

    Could you kindly shed some light to this?

    Regards,
    Daryl

  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 16 Jan 2015 Link to this post

    Hi Daryl,


    Thank you for contacting us. As it turns out, once you manually define the fields something went wrong with the alignment of the fields. This results to incorrect height of different types of fields in RadDataForm.
    The behavior could be considered as abnormal, because this could not be reproduced in our demos with manually defined data fields. 

    Do you have defined any styles targeted at TextBox element? 

    I believe that the best option here would be to prepare runnable project, that we could test by our side. 
    You may send it back to us as an attachment in a new support thread. 

    I look forward to hearing from you. 

    Regards,
    Vanya Pavlova
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Alan
    Alan avatar
    107 posts
    Member since:
    Oct 2010

    Posted 16 Jan 2015 in reply to Vanya Pavlova Link to this post

    Hi Vanya,

    Thank you very much for your help.

    Turns out I had a window resource targeting all TextBoxes outside of the user control that defined the RadDataForm - right in front of my face :). 

    Regards,
    Daryl
Back to Top