Professional UI Solutions
Site Map   /  Register
 
 

Forum

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 Tech Support » CExtGridCellNumber Collapse All
Subject Author Date
Offer Har Apr 16, 2007 - 6:25 AM

Dear Support,

I need to limit the range of a CExtGridCellNumber call to a min & max range.
I could not find any method for doing this, and I think this should be an integral part of a number cell.

Regards,
Ron.

Suhai Gyorgy Apr 16, 2007 - 6:49 AM

CExtGridCellNumber is derived from CExtGridCellVariant, which has the virtual methods OnQueryEnabledIncrement and OnQueryEnabledDecrement, so you can use the solution described in this FAQ: How to set a range for the CExtGridCellUpDown cell?

Offer Har Apr 16, 2007 - 6:54 AM

This does not help me...

I am using CExtGridCellNumber and not CExtGridCellUpDown, because I need to control the number of decimal points etc. which is availabe in the first and not in the later.

Also, these methods seems to handle only the spin control, and not the in-cell editing - correct me if I’m wrong.

So in general I need more support...

Thanks,
Ron.

Technical Support Apr 16, 2007 - 11:40 AM

You can control this in the following two ways:

1) At the cell level. Override the CExtGridCell::OnInplaceControlTextInputVerify() method.
2) At the grid level. Override the CExtGridWnd::OnGridCellInplaceControlTextInputVerify() method.

CExtGridCell::OnInplaceControlTextInputVerify() method of each cell calls the CExtGridWnd::OnGridCellInplaceControlTextInputVerify() method of the grid. So it is up to you which method to use. These virtual methods allow to control the text typing in the in-place activated edit control. They are called when the user is typing the text in the in-place editor and allows you to analyze the initial text and the final text version, so the input process is under your full control. Your method should return true if the text data has a valid format or a value is in the correct range. In other cases return false to prevent cell’s value changing.

Offer Har Apr 16, 2007 - 11:56 AM

If I use a spin control, do i need on top of these methods to implement also OnQueryEnabledIncrement and OnQueryEnabledDecrement, or does the OnInplaceControlTextInputVerify takes care of the spin change of content?

Technical Support Apr 17, 2007 - 12:43 PM

OnInplaceControlTextInputVerify() has nothing to do with OnQueryEnabledIncrement() and OnQueryEnabledDecrement() so you should override all these methods.