This is a migrated thread and some comments may be shown as answers.

DataFormDataField Label Width

1 Answer 160 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 18 Jul 2012, 07:11 AM
Hi,  Is there a way to set the DataFormDataField so that the TextBox has a MaxWidth, and the Label width stretches to cover the rest of the width of the DataField?

I'm trying to create a form where the responses will all be numeric (so the TextBox doesn't need to stretch to Infinity), but the length of the label varies wildly (ergo, does need to stretch).  The labels on my DataFormDataFields are being cut off to allow the TextBox (plus spacing) to have more room.  If I increase the width of the DataField, this increases the amount of space between the TextBox and the Label. 

I've played with the Width of the DataField, the Min, Max & Width of the DataField.Label, the Width of TextBoxes, all to no joy.  Similar results messing with HorizontalAlignment, HorizontalContentAlignment, and even ZIndex (I thought I could bring the label above the text box).

Thanks for any ideas, I'm at the stage where I'm about to start coding a Label + TextBox in a Stackpanel solution for each of my datafields, and I'd _really_ prefer not to.  

Also (coz I think it's relevant but I'm not sure), I don't have Expression Blend.

cheers

Alex



1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 18 Jul 2012, 01:58 PM
Hello Alex,

 In case you cannot edit the Template of the DataFormDataField using Blend, you could find it available within the Themes folder shipped with the RadControls for WPF. It is located in the "Telerik.Windows.Controls.Data.xaml" file and it is named "DataFormDataFieldTemplate".

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
DataForm
Asked by
Alex
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or