I have a number of resizable forms, and the default way that labels and controls resize themselves doesn't really work that well.
Thanks,
Dan.
5 Answers, 1 is accepted
In order to achieve this you should edit RadDataForm's ControlTemplate in Blend or VS2012. Currently fields' layout panel is a grid with 3 columns:
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"*"
/>
<
ColumnDefinition
Width
=
"2*"
/>
<
ColumnDefinition
Width
=
"24"
/>
</
Grid.ColumnDefinitions
>
<
Grid.RowDefinitions
>
<
RowDefinition
/>
<
RowDefinition
/>
</
Grid.RowDefinitions
>
Ivan Ivanov
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>

I'm new to WPF and while I very much want to learn it, so far it seems about as friendly as a rabid pitbull. I'm really interested in using the OpenAccess ORM for a new project, and I figured I might as well go all the way and do the UI in WPF with controls designed to be used with it, but I seem to be spending an inordinate amount of time trying to bend the UI into something useful that can be trivially done in 2 minutes with WinForms...
All I want to do is take this UserControl and style it so that the labels are fixed width and the controls themselves are anchored at the left and will stretch right as necessary.
<
UserControl
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:DataForm
=
"clr-namespace:Telerik.Windows.Controls.Data.DataForm;assembly=Telerik.Windows.Controls.Data"
x:Class
=
"PandaUI.Controls.ArtistInfo"
mc:Ignorable
=
"d"
Width
=
"409"
Height
=
"237"
>
<
Grid
>
<
Grid.Resources
>
<
DataTemplate
x:Key
=
"MyTemplate"
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"75*"
/>
<
ColumnDefinition
Width
=
"25*"
/>
</
Grid.ColumnDefinitions
>
<
Grid.RowDefinitions
>
<
RowDefinition
/>
<
RowDefinition
/>
</
Grid.RowDefinitions
>
</
Grid
>
</
DataTemplate
>
</
Grid.Resources
>
<
telerik:RadDataForm
x:Name
=
"dfArtistInfo"
Margin
=
"10"
AutoGenerateFields
=
"True"
EditTemplate
=
"{StaticResource MyTemplate}"
NewItemTemplate
=
"{StaticResource MyTemplate}"
ReadOnlyTemplate
=
"{StaticResource MyTemplate}"
/>
</
Grid
>
</
UserControl
>
I guess that you are trying to open a WPF 4.5 project in Blend 4, which supports only .Net 4 and lower versions. However, you can use VS2012 instead. Please, open the respective view in the designer, right-click the RadDataForm and choose edit template > edit a copy from the context menu. Then you can modify the grid panel in the ControlTemplate copy. Bare in mind that you should not use * size if you want constant width. Here is an article that sheds some more light on the matter.
Regards,Ivan Ivanov
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>

All I want to do is make the label fixed width, anchor the control on the left side and have it expand to fill the available space to the right.
Alternatively you can find the template in the XAML files that are shipped with the RadControls installation: Telerik\RadControls...\Themes\WPF40\Windows8\Themes\Telerik.Windows.Controls.Data
Regards,Ivan Ivanov
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>