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.

how to wrap Column headers

Thread ID:

Created:

Updated:

Platform:

Replies:

117804 Dec 18,2014 01:04 AM Dec 21,2014 08:54 PM Windows Forms 1
loading
Tags: GridGroupingControl
Rasika
Asked On December 18, 2014 01:04 AM

Hello,
I am using gridgrouping control
I want to wrap column headers.Is there any method for wrapping text?
 
Regards,
Rasika
  

Muthukumar Kalyanasundaram [Syncfusion]
Replied On December 21, 2014 08:54 PM

Hi Rasika,

 

Thank you for your interest in Syncfusion products.

 

If you want to set the wrap column header in a grid, you can enable the “WrapText” property as true. Please make use of below code,


Code:

 

Suggestion 1:

this.gridGroupingControl1.TableDescriptor.Appearance.ColumnHeaderCell.WrapText =true;

 

Suggestion 2:

this.gridGroupingControl2.TableModel.RowHeights.ResizeToFit(GridRangeInfo.Row(5), GridResizeToFitOptions.None);

this.gridGroupingControl2.TableModel.BaseStylesMap["Column Header"].StyleInfo.WrapText = true;

this.gridGroupingControl2.TableModel.BaseStylesMap["Column Header "].StyleInfo.AutoSize = false;

 

Suggestion 3:

this.gridGroupingControl2.TableControl.PrepareViewStyleInfo += new Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventHandler(TableControl_PrepareViewStyleInfo);

void TableControl_PrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs e)

{

if (e.RowIndex == 2  && e.ColIndex == 3) // Column header index

{

e.Style.WrapText = true;

e.Style.BackColor = Color.Red;

}

}

 

Please let us know if you have any concern.

 

Regards,

Muthukumar K



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.

;