Hi all togehter,
i have the following XAML in my Grid:
<Syncfusion:GridTemplateColumn HeaderText="Beschreibung" TextWrapping="Wrap" MappingName="Description">
<Syncfusion:GridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Description}" TextWrapping="Wrap" />
</DataTemplate>
</Syncfusion:GridTemplateColumn.CellTemplate>
<Syncfusion:GridTemplateColumn.EditTemplate>
<DataTemplate>
<TextBox Text="{Binding Description, Mode=TwoWay}"
ScrollViewer.VerticalScrollBarVisibility="Auto"
Syncfusion:FocusManagerHelper.FocusedElement="True"
AcceptsReturn="True"
TextWrapping="Wrap"
/>
</DataTemplate>
</Syncfusion:GridTemplateColumn.EditTemplate>
</Syncfusion:GridTemplateColumn>
I calculate the RowHight with:
QueryRowHeight="DataGrid_QueryRowHeight"
CurrentCellEndEdit="DataGrid_CurrentCellEndEdit"
Code is from google and the forum here..
Display the Multilie Text works as expected.
What i need to have is:
A editable textbox, with the possiblity to add new lines with the <CR> Key.
Thanks in advance
Peter
this.datagrid.SelectionController = new GridCellSelectionControllerExt(datagrid);
public class GridCellSelectionControllerExt : GridCellSelectionController
{
public GridCellSelectionControllerExt(SfDataGrid dataGrid)
: base(dataGrid)
{
}
protected override void ProcessKeyDown(KeyEventArgs args)
{
if (args.Key == Key.Enter)
{
args.Handled = false;
return;
}
base.ProcessKeyDown(args);
}
}
|