This question is locked. New answers and comments are not allowed.
Hello,
I am defining a DataTemplate within a DataForm this way:
I find that both setting HorizontalAligment = "Stretch" or setting it to "Left" and giving a, let's say, Width="200" in DataFormDataField controls, a sort of "margin" appears to their left, I mean, the more I raise the width, the more the boxes are shifted to the right, I only get them aligned to the left when using normal TextBoxes and the PasswordBox, what is this behaviour due to?
Thanks in advance
I am defining a DataTemplate within a DataForm this way:
<telerik:RadWindow.Resources> <DataTemplate x:Key="formTemplate"> <Grid x:Name="formGrid" ShowGridLines="True" MinWidth="100"> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> <RowDefinition /> <RowDefinition /> <RowDefinition /> <RowDefinition /> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="300" /> </Grid.ColumnDefinitions> <telerik:Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="15,10,15,10" HorizontalAlignment="Left" VerticalAlignment="Center" Content="Fields in bold are required." /> <telerik:Label Grid.Row="1" Grid.Column="0" Margin="15,0,0,0" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Center" Content="First Name" /> <telerik:DataFormDataField x:Name="firstNameDataField" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" IsRequired="True" /> <telerik:Label Grid.Row="2" Grid.Column="0" Margin="15,0,0,0" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Center" Content="Last Name" /> <telerik:DataFormDataField x:Name="lastNameDataField" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" IsRequired="True" /> <telerik:Label Grid.Row="3" Grid.Column="0" Margin="15,0,0,0" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Center" Content="Password" /> <PasswordBox x:Name="passwordBox" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Center" Width="120" /> </Grid> </DataTemplate> </telerik:RadWindow.Resources> <Grid x:Name="LayoutRoot"> <telerik:RadDataForm x:Name="signUpForm" AutoGenerateFields="False" EditTemplate="{StaticResource formTemplate}" Header="Create New Account" Mode="Edit" CommandButtonsVisibility="Commit" AutoEdit="True" CommitButtonContent="Sign Up" /> </Grid>I find that both setting HorizontalAligment = "Stretch" or setting it to "Left" and giving a, let's say, Width="200" in DataFormDataField controls, a sort of "margin" appears to their left, I mean, the more I raise the width, the more the boxes are shifted to the right, I only get them aligned to the left when using normal TextBoxes and the PasswordBox, what is this behaviour due to?
Thanks in advance