We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Multiline Textbox

Thread ID:





129906 Apr 9,2017 05:32 PM UTC Apr 11,2017 05:05 AM UTC WPF 3
Tags: SfDataGrid
Forstmeier Peter
Asked On April 9, 2017 05:32 PM UTC

Hi all togehter,

i have the following XAML in my Grid:

<Syncfusion:GridTemplateColumn HeaderText="Beschreibung" TextWrapping="Wrap"  MappingName="Description">
                            <TextBlock Text="{Binding Description}"  TextWrapping="Wrap" />
                            <TextBox Text="{Binding Description, Mode=TwoWay}"

I calculate the RowHight with:


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


Muthukumar Kalyanasundaram [Syncfusion]
Replied On April 10, 2017 07:17 AM UTC

Hi Peter, 
Thank you for contacting Syncfusion support. 
We have analyzed your query. You can achieve your requirement by overriding the ProcessKeyDown event in GridCellSelectionController class. By default, in the SfDataGrid on pressing the Enter key, the currentcell is moved to the next row, you can overcome this problem by setting KeyEventArgs.Handled as false in ProcessKeyDown event. For your reference, we have added the code snippet and sample in below location. Could you please refer to it. 
Code Snippet: 
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; 
Please let us know if you have any query. 
Muthukumar K 

Forstmeier Peter
Replied On April 10, 2017 06:09 PM UTC

Hi and thanks a lot.
Your example works perfectly.

Muthukumar Kalyanasundaram [Syncfusion]
Replied On April 11, 2017 05:05 AM UTC

Hi Peter, 
You are welcome. Please let us know if you need any other assistance. 
Muthukumar K 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon