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

GGC Autosize TextBox

Thread ID:





72355 Mar 14,2008 09:43 PM UTC Mar 24,2008 11:44 AM UTC WinForms 3
Tags: Grouping
Martin Hagenow
Asked On March 14, 2008 09:43 PM UTC


just one question:

I have an data table with a desciption (text) field which is shown in the GGC. Now I can enter the text into the grid - but:

1. it won't accept the enter-key for a new line
2. it is not adjusting the height of the row automatically

I tried to set up this behaviour in the "TableDescriptor\Columns\"Description"\Appearance\AnyRecordFieldCell"-Property by setting AllowEnter and Autosize. But it unfortunately has no effect.

Anybody an idea?

Thanks in advance!

Best Regards

Administrator [Syncfusion]
Replied On March 17, 2008 08:11 AM UTC

Hi Martin,

Thank you for using Syncfusion products.

1. GridGrouping Control won't accept the enter-key for a new line

By default, the GridGrouping Control allows to use enter for new line character. Could you please modify the below sample to reproduce the issue or send us the sample with the issue, so that we could provide you the exact solution early?

Here is sample:


2. GridGrouping Control is not adjusting the height of the row automatically

You can try handling the QueryCellStyleInfo event. But calling the ReSizeToFit method in the QueryCellStyleInfo event makes the recursive call. So you can set the RowHeight of the cell by using the CalculatePreferredCellSize method. You can refer the below forum thread for more details.

Here is the forum thread link:


Please let me know if you have any questions.

Subhasheela R

Martin Hagenow
Replied On March 17, 2008 01:04 PM UTC


By default, the GridGrouping Control allows to use enter for new line character.

Sorry, my fault I meant a new line in the textbox not in the Grid!

I want to enter a large amount of text into one cell. These shall include "\r\n". (Multiline textbox accepting "Enter")

I set the style of the Grid: \Appearance\AnyCell\AllowEnter=true but when I hit the enter key while editing the text the grid enters a new line and not the textbox.

Thanks in Advance!



Administrator [Syncfusion]
Replied On March 24, 2008 11:44 AM UTC

Hi Martin,

Sorry for the delay in getting back to you.

You can allow enter by setting WantEnterKey and AllowTextBoxAutoSize properties of GridGrouping Control. Also you can handle QueryCellStyleInfo event to set the AllowEnter, AutoSize and WrapText properties. Below is the code snippet:

this.gridGroupingControl1.TableControl.WantEnterKey = false;
this.gridGroupingControl1.TableControl.AllowTextBoxAutoSize = true;
private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
if (e.TableCellIdentity.ColIndex == 2 && e.TableCellIdentity.RowIndex > 0)
e.Style.BackColor = Color.Pink;
e.Style.AllowEnter = true;
e.Style.AutoSize = true;
e.Style.WrapText = true;

Here is the sample:


Please let me know if it helps.

Subhasheela R


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

This page will automatically be redirected to the 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