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.

Strange behavior in NumericUpDown cells

Thread ID:

Created:

Updated:

Platform:

Replies:

49379 Sep 18,2006 07:19 AM Sep 18,2006 09:01 AM Windows Forms 1
loading
Tags: Grouping
Alejandro Serrano
Asked On September 18, 2006 07:19 AM

Hi,
I''ve got a grid which uses NumericUpDown cells (the ones integrated in GGC) to show some numbers. Whenever they change, I process some information relating to it.
However, if the user enters a very big number (such as 99999999), the cell turns into a bunch of zeroes and there''s no way to change it until I recreate the grid using other parts of the application.
Is this a known bug? Is there any way to solve it? Am I doing something wrong?

Thanks in advance

Administrator [Syncfusion]
Replied On September 18, 2006 09:01 AM

Hi Alejandro,

To avoid this from happening, you can handle the TableControlCurrentCellValidateString event of the grid. This event gets fired for each keystroke; so you can cancel this event by setting e.Cancel to true when the entered number is greater than the limit. Below is the code snippet.

private void gridGroupingControl1_TableControlCurrentCellValidateString(object sender, GridTableControlCurrentCellValidateStringEventArgs e)
{
double d;
double.TryParse(e.Inner.Text, System.Globalization.NumberStyles.Any, null, out d);
if(d > 999999)
e.Inner.Cancel = true;
}

FYI, you can use this GridNumericUpDownCellModel.AcceptAlphaKeys property, this lets you specify whether the NumericUpDown cell should accept Alpha keys.

GridNumericUpDownCellModel cm = (GridNumericUpDownCellModel) this.gridGroupingControl1.TableModel.CellModels["NumericUpDown"];
cm.AcceptAlphaKeys = false;

Regards,
Rajagopal

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.

;