Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
160
Shifting text when editing values where the Padding and Margin on the editor has been set to 0
posted

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:

  1. Is there a better way to handle getting the space removed so that the spacing is tighter than the default without having this issue?
  2. If the answer to #1 is no, is there a way to work around this problem?

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