I Want align in middlecenter a icon. But how i do that?
The status Column is a imageColunm, and a put this code inside the cellformating.
I tried:
this.MsgDataGridView.Columns[“Status”].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
//this way is not working.
and,
e.CellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter //this way is not working.
how i can do?
Hi Jay,
You’ll probably want to use the CellStyle.BackgroundImageAlign property.
Try this line:
e.CellStyle.BackgroundImageAlign = ContentAlignment.MiddleCenter;
It should work fine!
HTH,
Alaa
//
Please login first to submit.