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.
Unfortunately, activation email could not send to your email. Please try again.

GGC Autosize TextBox

Thread ID:

Created:

Updated:

Platform:

Replies:

72355 Mar 14,2008 05:43 PM Mar 24,2008 07:44 AM Windows Forms 3
loading
Tags: Grouping
Martin Hagenow
Asked On March 14, 2008 05:43 PM

Hi,

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
Martin


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

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:

'>http://websamples.syncfusion.com/samples/Grouping.Windows/F72355/main.htm">
http://websamples.syncfusion.com/samples/Grouping.Windows/F72355/main.htm

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:


http://www.syncfusion.com/support/forums/message.aspx?MessageID=60375

Please let me know if you have any questions.

Regards,
Subhasheela R





Martin Hagenow
Replied On March 17, 2008 09:04 AM

Hi,


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!

Cheers,

Martin


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


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:

'>http://websamples.syncfusion.com/samples/Grouping.Windows/F72355FollowUp1/main.htm">
http://websamples.syncfusion.com/samples/Grouping.Windows/F72355FollowUp1/main.htm

Please let me know if it helps.

Regards,
Subhasheela R




CONFIRMATION

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.

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.

;