Hi,
i need to get the text within a cell wrapped. Is there any help provided?
codesample:
<igDP:Field Name="beschreibung" Label="Beschreibung"> <igDP:Field.Settings> <igDP:FieldSettings AllowEdit="false"/> </igDP:Field.Settings> </igDP:Field>
So what exactly i have to do?
Hello,
Just to add what Curtis has provided, that you can achieve this without retemplating the CellValuePresenter. As it uses PART named elements inside its template, retemplating it could break some of the XamDataGrid's logic (for example entering edit mode in some cases).
You can see a working example of how you can achieve this in the forum thread below :
http://community.infragistics.com/forums/p/24323/89171.aspx#89171.
Please make sure that you set the Cell/LabelWidth properties of the Field so that the Editor knows when to wrap the text.
Hi Paul,
Actually, a better solution (a more sure solution) is to utilize the CellValuePresenter Style.
The following XAML will assign a text editor with wrapping to a specific field in the grid.
<igDP:XamDataGrid>
<igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:FieldLayout.Fields> <igDP:Field x:Uid="Title" Name="Title"> <igDP:Field.Settings> <igDP:FieldSettings CellMinWidth="100" CellWidth="360" CellValuePresenterStyle="{StaticResource WrapField}"/> </igDP:Field.Settings> </igDP:Field> </igDP:FieldLayout.Fields> </igDP:FieldLayout></igDP:XamDataGrid.FieldLayouts>
</igDP:XamDataGrid>
Hi
I tried the XAML you posted but it seems to have no effect even when placed in the resource area for the form (as opposed to a more specific level in the control, such as the parent grid to the datagrid).
Do you have a sample showing in context how the style would be used?
Many thanks.
Paul
John's suggestion will apply wrapping to all XamTextEditors in the scope the style is defined.
The Style can also be declared in the XAML:
<Style TargetType="{x:Type igEditors:XamTextEditor}"> <Setter Property="TextWrapping" Value="Wrap"/></Style>
You can style the XamTextEditor's TextWrapping property. I'm not using XAML for this, but in C# it's something like:
wrapstyle.Setters.Add(new Setter(XamTextEditor.TextWrappingProperty, TextWrapping.Wrap));
myField.Settings.EditorStyle = wrapstyle;