Home Forums WinForms controls Xceed Grid for WinForms NumberCellEditor editing aligmment

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #14037 |

    How can I achieve that the NumberCellEditor is right aligned during edition? Can I use my NumberTextBox control here?
    Thanks

    Imported from legacy forums. Posted by szinkopa (had 2856 views)

    User (Old forums)
    Member
    Post count: 23064

    <pre>GridNumericTextBox editor = new GridNumericTextBox();
    editor.TextAlign = HorizontalAlignment.Right;</pre>

    Imported from legacy forums. Posted by Tommy (had 237 views)

    User (Old forums)
    Member
    Post count: 23064

    Thank you Tommy, that’s very cool. But I wouldn’t like to type this for every numeric cell. I will have tons of them. Which class should I extend to achieve this simply?
    Thanks

    Imported from legacy forums. Posted by szinkopa (had 461 views)

    User (Old forums)
    Member
    Post count: 23064

    You could just create 1 editor, and reuse it for all the columns:<pre>GridNumericTextBox editor = new GridNumericTextBox();
    editor.TextAlign = HorizontalAlignment.Right;
    col1.Editor = editor;
    col2.Editor = editor;
    …</pre>

    Imported from legacy forums. Posted by Tommy (had 3946 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.