I want to center the content of my Columns and Rows on DataGridView.
Is there a way of doing this by specifying the Column name, like:
dataGridView1.Columns["CustomerName"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
I want this to be applied to all the Columns of my DataGridView (which is completely coded programmatically).
How can I do this?
Try this.
dataGridView1.RowsDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With