Hi,
if you couldn't do it . i will send you my complete code that printing from right to left
1- replace the code that drawing columns with this code.
for (int i = GridViewID.Columns.Count - 1; i >= 0; i--)
{
e.Graphics.FillRectangle(new SolidBrush(Color.LightGray),
new Rectangle((int)arrColumnLefts[iCount], iTopMargin,
(int)arrColumnWidths[iCount], iHeaderHeight));
e.Graphics.DrawRectangle(Pens.Black,
new Rectangle((int)arrColumnLefts[iCount], iTopMargin,
(int)arrColumnWidths[iCount], iHeaderHeight));
e.Graphics.DrawString(" " + GridViewID.Columns[i].HeaderText, GridViewID.Columns[i].InheritedStyle.Font,
new SolidBrush(GridViewID.Columns[i].InheritedStyle.ForeColor),
new RectangleF((int)arrColumnLefts[iCount], iTopMargin,
(int)arrColumnWidths[iCount], iHeaderHeight), strFormat);
iCount++;
}
2- replace the code that drawing cells with this code
for (int i = GridRow.Cells.Count - 1; i >= 0; i--)
{
if (GridRow.Cells[i].Value != null)
{
e.Graphics.DrawString(" " + GridRow.Cells[i].Value.ToString(), GridRow.Cells[i].InheritedStyle.Font,
new SolidBrush(GridRow.Cells[i].InheritedStyle.ForeColor),
new RectangleF((int)arrColumnLefts[iCount], (float)iTopMargin,
(int)arrColumnWidths[iCount], (float)iCellHeight), strFormat);
}
e.Graphics.DrawRectangle(Pens.Black, new Rectangle((int)arrColumnLefts[iCount],
iTopMargin, (int)arrColumnWidths[iCount], iCellHeight));
iCount++;
}
Wish that could helps you.
Regards,
A.Mandour