Guest PauloR Posted April 23, 2009 at 01:29 AM Report #258442 Posted April 23, 2009 at 01:29 AM Como posso resolver este problema de alinhamento ? http://img7.imageshack.us/img7/4479/alinhamento.png Obrigado
jpaulino Posted April 23, 2009 at 07:27 AM Report #258451 Posted April 23, 2009 at 07:27 AM Olá, Podes fazer algo do género (onde o Cells(2) é o index da coluna), definindo um Style.Alignment individualmente paracada célula: For Each row As DataGridViewRow In Me.DataGridView1.Rows If Not row.IsNewRow Then If row.Index Mod 2 Then row.Cells(2).Style.Alignment = DataGridViewContentAlignment.MiddleLeft Else row.Cells(2).Style.Alignment = DataGridViewContentAlignment.MiddleRight End If End If Next
Guest PauloR Posted April 23, 2009 at 08:53 AM Report #258469 Posted April 23, 2009 at 08:53 AM Olá, Podes fazer algo do género (onde o Cells(2) é o index da coluna), definindo um Style.Alignment individualmente paracada célula: For Each row As DataGridViewRow In Me.DataGridView1.Rows If Not row.IsNewRow Then If row.Index Mod 2 Then row.Cells(2).Style.Alignment = DataGridViewContentAlignment.MiddleLeft Else row.Cells(2).Style.Alignment = DataGridViewContentAlignment.MiddleRight End If End If Next Obrigado 😛
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now