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
515
UltraCurrencyEditor not respecting MaxValue
posted

If you set MinValue = MaxValue = 0, the editor allows the user to enter anything from 0.01 to 0.99.

The following code snippet demonstrates the issue:

private void InitializeComponent()
{
 this.ultraCurrencyEditor1 = new Infragistics.Win.UltraWinEditors.UltraCurrencyEditor();
 ((System.ComponentModel.ISupportInitialize)(this.ultraCurrencyEditor1)).BeginInit();
 this.SuspendLayout();
 //
 // ultraCurrencyEditor1
 //
 this.ultraCurrencyEditor1.Location = new System.Drawing.Point(44,71);
 this.ultraCurrencyEditor1.MaxValue = new decimal(new int[ {
        0,
        0,
        0,
        0});
 this.ultraCurrencyEditor1.MinValue = new decimal(new int[ {
        0,
        0,
        0,
        0});
 this.ultraCurrencyEditor1.Name = "ultraCurrencyEditor1";
 this.ultraCurrencyEditor1.Size = new System.Drawing.Size(143,21);
 this.ultraCurrencyEditor1.TabIndex = 0;
 //
 // Form1
 //
 this.AutoScaleDimensions = new System.Drawing.SizeF(6F,13F);
 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
 this.ClientSize = new System.Drawing.Size(612,518);
 this.Controls.Add(this.ultraCurrencyEditor1);
 this.Name = "Form1";
 this.Text = "Form1";
 ((System.ComponentModel.ISupportInitialize)(this.ultraCurrencyEditor1)).EndInit();
 this.ResumeLayout(false);
 this.PerformLayout();

}

Parents
No Data
Reply
  • 37774
    posted

    I think that this is expected behavior.  In general, the masked editors allow you to modify individual sections of the control because they cannot tell if the user will move to a different section that will cause it to become valid.  For example, assume that I have a valid range of 0-1.  If the initial value of the control is 1, the user may want to start off in the decimal area and type "99", so the editor will now be showing "1.99"; however, the user could at this point want to then delete the 1, instead of having to delete the 1 before they type "99" in the decimal area.  The same behavior is true of date masks, where you may want to modify the day first before altering the month or year to put it into a valid range.  You will note on the UltraCurrencyEditor that you are not permitted to exit the currency editor until a valid range is entered.

    -Matt

Children
No Data