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
570
MaskInput and CellAppearance.TextHAlign not working correctly together on Cell Edit
posted

When I set the MaskInput for a column to "nnnn" and set the CellAppearance.TextHAlign to "Right", it causes my values to be cut off when a cell is in edit mode till cell gets repainted while in edit mode, at which point it then displays correctly. I tested both with and without a MaskInput being set, it only occured when the MaskInput was set.

Sets to reproduce:

  1. Put a grid on the form.
  2. Put a collection on the form
  3. Put a BindingSource on the form.
  4. Set the BindingSource DataSource to the collection
  5. Set the grid DataSource to the binding source
  6. Open the grid designer and for colum set the MaskInput to: nnnn
  7. For the same column that you set the MaskInput on, set the CellAppearance.TextHAlign to: Right
  8. Run the application
  9. Goto the column that you set the TextHAlign and MaskInput on and enter: 1
  10. Exit the cell and enter another
  11. Reenter the cell that you set the TextHAlign and MaskInput on, you will not be able to see the 1 till you force the cell to repaint while the cell is still in edit mode.

Is there a hotfix for this issue or a way to work around it so that it displays correctly initially?