Ahmed Mandur
Привет,
если ты не можешь этого сделать . я пришлю вам свой полный код, который печатается справа налево
1 - Замените код, который рисует столбцы, этим кодом.
//Draw Columns
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 - Замените код, который рисует ячейки, на этот код
//Draw Columns Contents
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);
}
//Drawing Cells Borders
e.Graphics.DrawRectangle(Pens.Black, new Rectangle((int)arrColumnLefts[iCount],
iTopMargin, (int)arrColumnWidths[iCount], iCellHeight));
iCount++;
}
Жаль, что это не может вам помочь.
С уважением,
А. Мандур