We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

MaxValue and MinValue in a GridCurrency cell?

Thread ID:

Created:

Updated:

Platform:

Replies:

5211 Jun 25,2003 05:35 AM Mar 8,2005 04:15 AM Windows Forms 5
loading
Tags: GridControl
Olivier Choquette
Asked On June 25, 2003 05:35 AM

I want to be able to set a maximum/minimum value to a currency edit cell but no appropriate properties are available in GridStyleInfo.CurrencyEdit. There are maxvalues and minvalues properties in the CurrencyTextBox class but i don't know how to access it. Olivier

Administrator [Syncfusion]
Replied On June 25, 2003 08:05 AM

Try using the Maximum and Minimum properties in the style's ValidateValue property. style.CurrencyEdit.PositiveColor = System.Drawing.Color.Black; style.ValidateValue.Maximum = 10000; style.ValidateValue.Minimum = 0;

Administrator [Syncfusion]
Replied On March 7, 2005 04:03 AM

I have the same issue, but I want to handle when user typing a value in a cell. User can not type a value greater than the maximum value ( I don''t like raise an error message). I try using CurrentCellKeyPress event, but I can not handle this issue. Please let me know how to resolve this issue. Thanks, >Try using the Maximum and Minimum properties in the style''s ValidateValue property. > > >style.CurrencyEdit.PositiveColor = System.Drawing.Color.Black; >style.ValidateValue.Maximum = 10000; >style.ValidateValue.Minimum = 0; > >

Administrator [Syncfusion]
Replied On March 7, 2005 05:33 AM

In 3.0.1.0, you can try handling the KeyValidate event on the mebeeded CurrencyEdit control, and canceling that event if the value is not what you want. This event is raised keystroke by keystroke. To subscribe to it, use code like: GridCurrencyTextBoxCellRenderer cr = this.gridControl1.CellRenderers["Currency"] as GridCurrencyTextBoxCellRenderer; GridCurrencyTextBox tb = cr.Control as GridCurrencyTextBox; tb.KeyValidate += new Syncfusion.Windows.Forms.Tools.KeyValidateEventHandler(tb_KeyValidate);

Hoang Dinh
Replied On March 7, 2005 11:53 PM

Are there anyway to control this issue? I''m using version 2.1.0.9.

Administrator [Syncfusion]
Replied On March 8, 2005 04:15 AM

You checked, and this event is not available in 2.1.0.9? It was added in the last 4-5 months, so it may not be in 2.1.0.9. Using this event would be the simplest thing to do if it is available. If it is not available, then the only way I would know to gat at these keystroke soon enough to prevent the keys from being processed is to derive the GridCurrencyTextBoxCellRenderer, GridCurrencyTextBoxCellModel, and GridCurrencyTextBox classes. In the textbox class, you can override ProcessCmdKey and catch keystrokes there. You need to derive the other classes so your can use your derived GridCurrencyTextBox in a cell. This will take some coding, but I think is doable.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;