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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Force Text entry in Upper Case

Thread ID:

Created:

Updated:

Platform:

Replies:

51546 Nov 8,2006 08:13 AM UTC Nov 8,2006 08:42 AM UTC Windows Forms 1
loading
Tags: GridControl
Venkatesh Venkatasubramanian
Asked On November 8, 2006 08:13 AM UTC

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.

Administrator [Syncfusion]
Replied On 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

CONFIRMATION

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.

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

;