C# .NET - How to write texts right to left datagridview selected columns ?

Asked By Gokhan Metepe on 04-Oct-11 09:29 AM

In my datagridview, i want to see some columns texts at right. In text box control we can do that with RightoLeft = Yes value. I have tried it with these codes. but it changed columns places on datagridview. Here is the code ;

dgvDiBilancio.Columns[4].DataGridView.RightToLeft = RightToLeft.Yes;

Sreenath Kalahasti replied to Gokhan Metepe on 05-Oct-11 06:01 PM
Looks like you want to change Only one Column's text to align right.

You can try this :

dataGridView1.Columns[0].HeaderCell.Style.Alignment = DataGridViewContentAlignment.TopRight;

and let me know if this what you were looking for?

Thanks,
Sree