GridControl cell default text alignment

Hi!

I use GridExcelConverterBase.ExcelToGrid method to get GridModel collection from IWorkbook.

When I assign GridModel to GridControl and display it, then those cells, that has no alignment set, are displayed "Center" aligned.
MS Excel in such situations displays text "Left" aligned.

How to change this default GridControl cell alignment to set default text alignment to "Left"?

Thanks in advance!

1 Reply

AD Administrator Syncfusion Team November 3, 2006 04:34 AM UTC

Hi Edijs,

Use the .HorizontalAlignment property of the GridStyleInfo object to specify the horizontal cell text alignment in a grid. Here is a code snippet.

this.gridControl1.TableStyle.HorizontalAlignment = GridHorizontalAlignment.Center;

//specify the horizontal cell text alignment in a grid
//this.gridControl1.TableStyle.VerticalAlignment = GridVerticalAlignment.Top;

Best Regards,
Haneef

Loader.
Up arrow icon