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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Strange behavior in NumericUpDown cells

Thread ID:





49379 Sep 18,2006 11:19 AM UTC Sep 18,2006 01:01 PM UTC WinForms 1
Tags: Grouping
Alejandro Serrano
Asked On September 18, 2006 11:19 AM UTC

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 01:01 PM UTC

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;



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