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. Image for the cookie policy date

Force Text entry in Upper Case

Hi,

I am using Grid 4.1. I have a editable combobox in the grid. I would like to force Upper case entry in the combo box. Even if the user types in lower case, it should be rendered as Upper Case in real time.

Can you please let me know if this is possible.

Thanks!
Venkatesh V.

1 Reply

AD Administrator Syncfusion Team November 8, 2006 08:42 AM UTC

Hi Venkatesh,

You would have to derive the combobox cell renderer and override the OnKeyPress method. Please try the attached sample and let me know if this helps.

public class MyComboBoxCellRenderer : GridComboBoxCellRenderer
{
public MyComboBoxCellRenderer(GridControlBase grid, GridCellModelBase cellModel)
: base(grid, cellModel)
{ this.SupportsFocusControl = true; }

protected override void OnKeyPress(KeyPressEventArgs e)
{
char c = e.KeyChar.ToString().ToUpper()[0];
KeyPressEventArgs arg = new KeyPressEventArgs(c);
base.OnKeyPress (arg);
e.Handled = true;
}
}

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/ComboBox_f015379f.zip

Best Regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon