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
890
ColumnStyle.IntegerNonNegativeWithSpin How to get rid of PromptChars/Padding?
posted

Hi All,

I have a column of type IntegerNonNegativeWithSpin.  By default, when in cell edit mode, my cell looks like this:

_________7

I dont like the underscores (_) so I set PromptChar = "".  Now I get:

          7

But what I want is:

7

How do I get rid of the padding to the left of the number?  I've tried setting PadChar = "", but it has no effect.

Thanks in advance!

Scott

  • 469350
    Verified Answer
    Offline posted

     Hi Scott,

        I don't think you can. If you want to use a mask, then the mask has to have prompt characters. So I don't beleive you can do this with a Style of IntegerNonNegativeWithSpin. 

        What you could probably do instead is use an editor. Place an UltraTextEditor control on your form. Use the ButtonsRight collection to add a SpinEditorButton to it. Then set the EditorControl property of the column to the UltraTextEditor. This will give you a spin button the grid cell without a mask. 

        There are a couple of disadvantages to this approach, though.  

        You will need to handle the EditorSpinButtonClick event of the UltraTextEditor and handle the spinning yourself in code. It won't automatically increment/decrement the value of the cell. This is probably no big deal.

        The other problem is that, without a mask, this editor will not enforce the entry of only numeric characters. So the user may enter letters or invalid characters. So your logic willneed to deal with that.