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

GridCurrencyCell and ActivateCurrentCellBehavior (v 2.0)

Thread ID:





10159 Jan 23,2004 12:54 PM UTC Jan 23,2004 03:34 PM UTC WinForms 2
Tags: GridControl
Administrator [Syncfusion]
Asked On January 23, 2004 12:54 PM UTC

I created my own GridCurrencyCell, but I''m having trouble with the ActiveCurrentCellBehavior. Attached is a small example, using my CustomCurrencyCell. I want to accomplish the same behavior as in the TextBox cell (1st column) so when the user start typing the cell will enter in Edit Mode (2nd column). TIA Jose. Combo2_7454.zip

Administrator [Syncfusion]
Replied On January 23, 2004 01:44 PM UTC

I think you need to override OnKeyDown in the renderer class and activate the cell there if it is not already active. Below is a try at this.
protected override void OnKeyPress(KeyPressEventArgs e)  
	bool controlKeyDown = (Control.ModifierKeys & Keys.Control) != Keys.None;
	bool menuKeyDown = (Control.ModifierKeys & Keys.Alt) != Keys.None;
	if (!e.Handled && !controlKeyDown && !menuKeyDown)
		if (!Char.IsControl(e.KeyChar) 
			&& !IsReadOnly()        // cell is not readonly
			&& SupportsFocusControl)    // OnStartEditing notification returns true
			if (!CurrentCell.HasControlFocus )
				if (this.ValidateString(e.KeyChar.ToString())
					&& CurrentCell.BeginEdit())
					CurrentCell.HasControlFocus = true;
					if (this.NotifyCurrentCellChanging())
						CurrentCell.IsModified = true;
						CurrencyTextBox.Text = e.KeyChar.ToString();
						CurrencyTextBox.SelectionStart = 1;
						CurrencyTextBox.SelectionLength = 0;
				e.Handled = true;

Administrator [Syncfusion]
Replied On January 23, 2004 03:34 PM UTC

Just what I wanted. Thanks!!!


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon