GridListControl and HorizontalAlignment

Hi,

I have a GLC and I want to set the HorizontalAlignment of my cells to "center". How can this be done?

I have seen that there is an option in the gridListControl.TableStyle.HorizontalAlignment but this seems to have no influence on the cells.

Cheers,
Franz

1 Reply

AD Administrator Syncfusion Team October 12, 2007 02:13 PM UTC

To get the alignment to 'take' in the GridListControl, I think you will need to handle the embedded grid's QueryCellInfo.

//subscribe to the event
this.gridListControl1.Grid.QueryCellInfo += new GridQueryCellInfoEventHandler(Grid_QueryCellInfo);


//the handler
void Grid_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
if (e.RowIndex > 0 && e.ColIndex > 0)
{
e.Style.HorizontalAlignment = GridHorizontalAlignment.Center;
}
}





Loader.
Up arrow icon