Hi,
how to use the alignment value "Infragistics.Excel.HorizontalCellAlignment.CenterAcrossSelection". This is exactly the functionality I need. I'm exporting an excel and I need to place a heading that is centered across 3 to n columns. The problem is that I have to use wrapping and autoheight. When I use MergedCellsRegion autoheight combined with wrapping it will not place my multiline text in a proper way. Excel sets the height of this line alway to the size of the first line so that all other lines are hidden. So CenterAcrossSelection could be the solution, but I don't know how to use. I can't find a property or method to set range or selection of multiple cells.
Thank you for any help,
Michael
This is a good question that was never answered. How do you use the CenterAcrossSelection horizontal alignment?
Yes it seems you're right. Sorry about that. You can use the CenterAcrossSelection alignment by setting that alignment on a set of horizontally adjacent cells, one of which being the cell with the value you want to center:
Workbook workbook = new Workbook(WorkbookFormat.Excel2007);Worksheet worksheet = workbook.Worksheets.Add("Sheet1");
WorksheetRow row = worksheet.Rows[0];row.Cells[0].Value = "Centered Text";for (int i = 0; i < 10; i++) row.Cells[i].CellFormat.Alignment = HorizontalCellAlignment.CenterAcrossSelection;
Thanks!