AD
Administrator
Syncfusion Team
June 25, 2003 12:05 PM UTC
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;
AD
Administrator
Syncfusion Team
March 7, 2005 09:03 AM UTC
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;
>
>
AD
Administrator
Syncfusion Team
March 7, 2005 10:33 AM UTC
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);
HD
Hoang Dinh
March 8, 2005 04:53 AM UTC
Are there anyway to control this issue?
I''m using version 2.1.0.9.
AD
Administrator
Syncfusion Team
March 8, 2005 09:15 AM UTC
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.