
Originally Posted by
formlesstree4
Per MSDN documentation, the
Control object (which is what the DataGridView inherits) is what is set as
RightToLeft. There is no property or method to set a
DataGridViewColumn RightToLeft because it is not a Control. You must set the entire control (aka, the DataGridView itself) to be RightToLeft.
thanks ... but i found a way with Cell_Painting event in c#... i used it and it is ok :
Code:
private void RTLColumnsDGV_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
if (e.ColumnIndex == RTLColumnID && e.RowIndex >= 0)
{
e.PaintBackground(e.CellBounds, true);
TextRenderer.DrawText(e.Graphics, e.FormattedValue.ToString(),e.CellStyle.Font, e.CellBounds, e.CellStyle.ForeColor,TextFormatFlags.RightToLeft | TextFormatFlags.Right);
e.Handled = true;
}
}