I have set the following style on the XamDataGrid which was used to remove the spacing that was causing the grid rows to take up more space than necessary when displaying the records.
<Grid.Resources>
<Style TargetType="{x:Type igEditors:XamTextEditor}"> <Setter Property="Padding" Value="0"/> <Setter Property="Margin" Value="0"/> </Style>
</Grid.Resources>
When a cell goes into edit mode the text shifts downward. When I use the left and right arrows to move between the characters, the text shifts up and down on every other character.
An example would be the following text: "Have a nice day!"
If the cursor is in front of the 'H' the text is shifted down. If the cursor is between the 'H' and 'a' the text is shifted up. If the cursor is between the 'a' and 'v' the text is shifted down. This pattern repeats on all of the other characters.
The following are my questions:
If the answer to #1 is no, my initial thought to work around the issue was to make the row larger by setting the padding and margin back to the original value for that row while in edit mode. I am not 100% sure how to do this on the single row but I think it would have a cool effect. Help with this idea would be appreciated if there is no fix to the issue.
Thanks!
Durant
Torrey,
That worked but I am not sure I understand why that works.
Do you happen to know why that occurs?
This is my first major jump into WPF and there are many things I have not quite figured out about the technology. I have been mostly buried in WinForms coding for many years, but some of the WPF stuff is still tripping me up. :-)
Thank you for your help regarding this!
Have you tried a snippet of code similar to what I've pasted below?
<igDP:XamDataGrid.Resources>
<Style TargetType="{x:Type igEditors:XamTextEditor}">
<Setter Property="Margin" Value="0" />
</Style>
</igDP:XamDataGrid.Resources>
Using the Padding property with a 0 value results in that jumpy shifting when moving through a cell value. When I tested out my own code above the shifting stopped when using Margin by itself.