KrisTrip
KrisTrip

Reputation: 5043

DataGrid Row Headers Don't Align with Content

I have a WPF DataGrid and the row headers don't line up vertically with the content. Any idea why? enter image description here

Upvotes: 1

Views: 441

Answers (3)

KrisTrip
KrisTrip

Reputation: 5043

Seems like the RowHeaders default to VerticalAlignment = Center and TextBlock defaults to Top. They are still a little off from one another but once I changed that property it was close enough for me!

Upvotes: 1

NominSim
NominSim

Reputation: 8511

I believe by default the row headers are aligned like that. You should be able to tell what alignment you want by saying something like:

yourDataDrid.RowHeaderStyle.BasedOn = yourDataDrid.CellStyle;

Upvotes: 0

Andrius Naruševičius
Andrius Naruševičius

Reputation: 8578

Have you tried making the row height to lets say double of it's current size? It might point you that you have different alignment/padding properties set for them :) Just a suggestion tho :) And yeah, code would be helpful :)

Upvotes: 0

Related Questions