ALINHAR TEXTO DAS COLUNAS DBGRIDVIEW
Boa noite
Coloco este codigo mas não alinha o texto das colunas, já usei o indice das colunas, o nome das colunas
DataGridView1.Columns([Ô]ID[Ô]).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
DataGridView1.Columns([Ô]CGC[Ô]).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
DataGridView1.Columns([Ô]Cep[Ô]).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
DataGridView1.Columns([Ô]UF[Ô]).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
DataGridView1.Columns(0).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
DataGridView1.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
DataGridView1.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
DataGridView1.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
Fica tudo a esquerda
Obrigado
Coloco este codigo mas não alinha o texto das colunas, já usei o indice das colunas, o nome das colunas
DataGridView1.Columns([Ô]ID[Ô]).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
DataGridView1.Columns([Ô]CGC[Ô]).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
DataGridView1.Columns([Ô]Cep[Ô]).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
DataGridView1.Columns([Ô]UF[Ô]).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
DataGridView1.Columns(0).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
DataGridView1.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
DataGridView1.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
DataGridView1.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
Fica tudo a esquerda
Obrigado
limpe a colunas antes de carregar as tabela no gridview
dataGridViewWork.Columns.Clear()
dataGridViewWork.Columns.Clear()
Tópico encerrado , respostas não são mais permitidas