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 » CExtGridCellComboBox and user input. Collapse All
Subject Author Date
Takis Takoglou Jun 12, 2009 - 2:30 AM

Good Day,

I am using many CExtGridCellComboBox objects in my PropertyGrid.

I wanted to find a way to prevent the user to enter his own text when the "text part" of the combobox is selected.

By using the SetEnumMode() method i thought this was accomplished, but this is half the truth.

The user cannot enter a new string, but if he presses a key which is the first letter of a string in the combobox, then that string is selected and an Apply() is invoked . This behavior is unwanted.

To make things worse, in the above scenario if there are more than one strings starting with the pressed key then one of them is selected, probably not the one intended to be used.

So what i am asking for is a way to prevent the user from using keys within the "text field" of the combobox.

Thanx in advance,


Technical Support Jun 12, 2009 - 6:00 AM

You apply use the __EGCS_READ_ONLY grid cell style using the CExtGridCell::ModifyStyle() method to make the in-place activated cell editor read only. The __EGCS_NO_INPLACE_CONTROL style disables in-place editor activation. The __EGCS_EX_NO_INPLACE_CONTROL_SELECTION extended grid cell style can be applied with the CExtGridCell::ModifyStyleEx() method for disabling the entire text selection in the in-place activated cell editor (editor appears over the cell, but text is not selected in it).