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. Image for the cookie policy date
close icon

Text alignment in a ComboBox style cell of a GridGroupingControl

Hello, everybody.

I need to force the text of the elements in a ComboBox style cell, when it is popped up, to be left aligned.

I've tried TextAlign property of the Appearance.AnyRecordFieldCell GridStyleInfo, but it doesn't work to me. The always appear right aligned.

Does anyone know how to do it?

Thank you very much in advance.

3 Replies

HA haneefm Syncfusion Team May 23, 2007 03:40 PM UTC

Hi José,

Please set the HorizontalAlignment property to control the behavior of horizontal text alignment in a combobox cell.

this.grid.TableDescriptor.Appearance.AnyRecordFieldCell. HorizontalAlignment = GridHorizontalAlignment.Left;

Best regards,
Haneef


EH edgar hernandez February 25, 2013 06:01 PM UTC

as I can put the header of a column in a vertical position, I tried this way and do not get
 

If

(e.Style.CellType = "ColumnHeaderCell" And e.Style.Text = "Drafting") Then

e.Style.Font.Orientation = 90

   end if



VK Vinish Kumar K Syncfusion Team February 26, 2013 12:06 PM UTC

Hi edgar,

 

Thank you for your interest in Syncfusion products.

 

Query

Vertical text align

There are couple of ways to set the Column Header Text Alignment:

 

<code>

this.grid.BaseStylesMap["Header"].StyleInfo.Font.Orienta

tion=90;

</code>

 

<code>

private void grid_PrepareViewStyleInfo(object sender,

Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs e)

{

if((e.ColIndex==1) && (e.RowIndex==0))

{

e.Style.Font.Italic=true;

e.Style.Font.Bold=true;

e.Style.Font.Size=10;

e.Style.Font.Orientation=90;

e.Style.TextColor=Color.Red;

}

 

If you use BaseStylesMap, it will work for the whole header column. But to make changes to individual cell you need to handle PrepareViewStyleInfo event

 

We have provided the solution based on your last update. We hope this will helps to you. If this didn’t helps to you please provide any simple sample which is you have used in to reproduce and some more details. We will provide an exact support quickly.

Please let me know if you have any further concerns.

Warm Regards,

Vinish Kumar K


Loader.
Live Chat Icon For mobile
Up arrow icon