in
Forums
Blogs
Files
Devexpress.Com
ClientCenter
Support Center
DevExpress Channel

SpinEdit - how to manually force value to post to bound object?

Last post 8/12/2008 7:34 PM by Andrew Backer. 3 replies.
Page 1 of 1 (4 items)
Sort Posts:
Previous Next
  • 7/31/2008 2:50 PM

    SpinEdit - how to manually force value to post to bound object?

    I have a few spinedits on my form, but the values are not posting ot the object because the controls aren't being touched.  The main issue, I think, is that the fields they are bound to are strings, not integer/decimal/float.

    1. Item has two "string" fields, which are initialized to ""
    2. Form has two spin edits
    3. Bind the spin edits up
    4. Load the form, set the datasource
    5. Spin edits show ZERO as the values
    6. Close the form
    7. Bound object still shows "" as the value

    This doesn't seem too "wrong", just not what I need.  Was wondering if there is some way to force it to push the value so this can't happen, or to do it manually?  My fall back is to just default the fields to the numeric "0" before I bind the object.

    Thanks,

    //Andrew

     

  • 7/31/2008 5:09 PM In reply to

    Re: SpinEdit - how to manually force value to post to bound object?

    Try calling the DoValidate() method on your SpinEdits before you close the form.

    http://www.logisticdynamics.com
  • 7/31/2008 8:31 PM In reply to

    Re: SpinEdit - how to manually force value to post to bound object?

    Thanks,Brendon.

    Already tried, unfortunatly to no effect.

    I have gotten around this by setting the objects properties to the string "0" when loading the form =)

  • 8/12/2008 7:34 PM In reply to

    Re: SpinEdit - how to manually force value to post to bound object?

    Still having this problem, now with a bug?  Perhaps this should be a support issue then...

    I have a spin control for "maximum length", data bound
    The max value of the spin control depends on value of another control
    When the other control's value changes, I change Properties.MaxValue

    Now, the issue is still this:

    1. Enter 100 in the spin
    2. Set the MaxValue to 50 in code
    3. Lose focus on the control that cause the MaxValue to change (button/combo)
    4. Value is reset to 100!
    5. Enter the spin
    6. Value is reset to 50!

    Arg. It would be enough if I could force the control to post it's valid value back immediatly when I change the max/min.  Is there really no way to do this?

    // Andrew

Page 1 of 1 (4 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED