how to wrap Column headers

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

1 Reply

MK Muthukumar Kalyanasundaram Syncfusion Team December 22, 2014 01:54 AM UTC

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



Loader.
Up arrow icon