Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » CExtGridCellNumber Showing only 2 decimal places Collapse All
Subject Author Date
Douglas Hoppes Mar 26, 2008 - 7:22 AM

Hi all,

     I have a cell that is a CExtGridCellNumber and am trying to place the value 12.435632432436.  When I use the _VariantAssign to store my float value in the grid, the grid always shows 12.44.  Is there a way that I can show 12.4356?



Takis Takoglou Mar 27, 2009 - 5:27 AM


I’m having the same problem here.I have already used for a spin button:

        pValue->SetNumDigits (4);

        pValue->_VariantAssign( 0.252);

but there are only 2 digits displayed...if i change my local settings they are properly displayed what’s wrong?

If i wanted my spin button field to display only positive values with the maximum of say 100?

I would also like to know if there is a way to set the spin button to custom increments for example +/- 0.01 or 0.2 instead of the default +/-1


Thanx in advance,







Technical Support Mar 27, 2009 - 2:00 PM

The CExtGridCellNumber::OnQueryNumDigits() virtual method returns a locale independent number of digits if you specified it using the CExtGridCellNumber::SetNumDigits() method. Please check your code.
If you need to implement value limits and custom incrementation/decrementation in your number cell, then you should create and use your own CExtGridCellNumber-derived class which implements the CExtGridCell::OnInplaceControlTextInputVerify(), CExtGridCell::OnValueIncrement() and CExtGridCell::OnValueDecrement() virtual methods. Please do not forget to insert the IMPLEMENT_ExtGridCell_Clone macros into declaration of your grid cell class and read the following important note:

Takis Takoglou Mar 31, 2009 - 2:01 AM

Good Day

the implementation of the classes you described above is very useful, thanks alot ;)

but unfortunately the number of digits displayed will not work for me...

i have used the CExtGridCellNumber::OnQueryNumDigits() as you described and it returned the correct value, 4.

When i run the program though, only 2 digits are displayed.

When i select the field , all digits are displayed correctly but when something else is selected they disappear.

Technical Support Mar 27, 2008 - 2:10 PM

Please use the CExtGridCellNumber::SetNumDigits() method which specifies the number of fractional digits. The default value is -1. In this case we are using information specified by the LCTYPE constant value LOCALE_IDIGITS.