Hi.
I would like to align my pdf when exported in such a manner that all string columns are aligned left and numeric columns aligned right. I have tried many different ways with no such result. Below is a code snippet of what I am currently using.
The method is then called in the item_created event. This code is being used to try align headings to left and data to right with not much success.
Any help would be greatly appreciated.
Kind regards.
Leon Havenga
I would like to align my pdf when exported in such a manner that all string columns are aligned left and numeric columns aligned right. I have tried many different ways with no such result. Below is a code snippet of what I am currently using.
private
void
ApplyStylesToPDFExport(GridItem item)
{
if
(item
is
GridHeaderItem)
foreach
(TableCell cell
in
item.Cells)
{
cell.Style[
"font-family"
] =
"Verdana"
;
cell.Style[
"text-align"
] =
"Left"
;
cell.Style[
"font-size"
] =
"12pt"
;
}
if
(item
is
GridDataItem)
{
item.Style[
"font-size"
] =
"12px"
;
item.Style[
"background-color"
] = item.ItemType == GridItemType.AlternatingItem ?
"#DDDDDD"
:
"#AAAAAA"
;
item.Style[
"horizontal-align"
] =
"Right"
;
}
}
The method is then called in the item_created event. This code is being used to try align headings to left and data to right with not much success.
Any help would be greatly appreciated.
Kind regards.
Leon Havenga