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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

MaxValue and MinValue in a GridCurrency cell?

Thread ID:





5211 Jun 25,2003 09:35 AM UTC Mar 8,2005 09:15 AM UTC WinForms 5
Tags: GridControl
Olivier Choquette
Asked On June 25, 2003 09:35 AM UTC

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 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;

Administrator [Syncfusion]
Replied On 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; > >

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

In, 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 8, 2005 04:53 AM UTC

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

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

You checked, and this event is not available in It was added in the last 4-5 months, so it may not be in 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.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon