User (Old forums)MemberJune 17, 2008 at 1:26 pmPost count: 23064
I have a grid the user will enter data into, and while they are doing so I want to display what they type in a text box that has a larger font. Is there a way for me to get the text the user has currently typed while the cell is still in edit mode? I can get the value after they have gone to the next form, but not as they type.
I hope that is clear, thanks for your help.
Imported from legacy forums. Posted by Arthur (had 596 views)User (Old forums)MemberJune 17, 2008 at 4:13 pmPost count: 23064
Yes, this is possible. The way to do it will depend on the editor being use for the column in which you want to do it. For example, use the TextChanged event for a WinTextBox editor. Note that you need to subscribe to WinTextBox events through the ActivatingControl event of the CellEditorManager. This is necessary because the editor is actually initialized only when the cell receives focus, and enters the edit mode.
private void Form1_Load(object sender, System.EventArgs e)
gridControl1.Columns[ “City” ].CellEditorManager.ActivatingControl += new CellEditorEventHandler(CellEditorManager_ActivatingControl);
gridControl1.Columns[ “City” ].CellEditorManager.DeactivatingControl += new CellEditorEventHandler( CellEditorManager_DeactivatingControl );
private void CellEditorManager_ActivatingControl(object sender, CellEditorEventArgs e)
( ( WinTextBox )e.Control ).TextBoxArea.TextChanged += new EventHandler( TextBoxArea_TextChanged );
private void CellEditorManager_DeactivatingControl( object sender, CellEditorEventArgs e )
//need to unsubscribe every time the editor is deactivated, if not, the subscriptions will kept pilling up!
( ( WinTextBox )e.Control ).TextBoxArea.TextChanged -= new EventHandler( TextBoxArea_TextChanged );
private void TextBoxArea_TextChanged( object sender, EventArgs e )
System.Diagnostics.Debug.WriteLine( ( ( TextBoxArea ) sender).Text);
Imported from legacy forums. Posted by André (had 809 views)
- You must be logged in to reply to this topic.