نوشته شده توسط
pooya1072
سلام
من می خوام خاصیت RightToLeft رو تنها برای یکی از ستونهای دیتاگریدویو True کنم . چطور می تونم این کار رو انجام بدم . دیتاگریدویو در حالت نرمال فقط به صورت کلی این خاصیت رو تغییر میده.
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;
}
}