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

currentcellclosedropdown question

Is there an event that i can use that will fire when someone is in a dropdown cell and uses the keyboard to select the data in it instead of using the mouse which fires the currentcellclosedropdown event. i have some code that i want to happen any time they enter data in this either by using the mouse or using the keyboard which doesnt fire that event???

8 Replies

PB Philip Bishop March 8, 2005 11:45 AM

I wanted to add that id just basically like to be able to have it go to the currentcellclosedropdown event. i know i can chect the currentcellchanged and see what the colindex is to see if im in a col that has dropdowns, but i dont know how to then fire that event. maybe im thinking about it the wrong way.


AD Administrator Syncfusion Team March 8, 2005 12:24 PM

I am not sure what kind of dropdown cell you have or what keys you are trying to cacth, but you can try the CurrentCellControlKeyMessage event.
private void gridControl1_CurrentCellControlKeyMessage(object sender, GridCurrentCellControlKeyMessageEventArgs e)
{
	Keys keyCode = (Keys) ((int)e.Msg.WParam) & Keys.KeyCode;
	if(keyCode == Keys.Down || keyCode == Keys.Up)
	{
		Console.WriteLine("CurrentCellControlKeyMessage");
		//e.CallProcessKeyPreview = false;
		//e.CallBaseProcessKeyMessage = true;
	}
}


AD Administrator Syncfusion Team March 8, 2005 01:26 PM

One other comment is that CurrentCellCloseDropDown should be hit whether your user presses the Enter key to select something or clicks the mouse to select something. This event is hit for me in the \Syncfusion\Essential Suite\3.0.1.0\Windows\Grid.Windows\Samples\CellTypes\ComboboxCells sample.


PB Philip Bishop March 8, 2005 02:03 PM

Clay, Here is sample. Click cell 1,2 and select one of the numbers. After you click the number notice it populates cell 1,3. Now if you arrow to a cell with say your down arrow key so you are on say a blank cell in 3,2 and this time type in number 3. Regardless of whether or not you hit enter after typing the 3 it never goes to the dropdownevent and i can only guess because i never opened and closed really? Does this help?? If it doesnt attach i will email it. Phil


AD Administrator Syncfusion Team March 8, 2005 02:17 PM

CurrentCellCloseDropDown will only be raised if the dropdown closes. If you you have never dropped the dropdown, this event will not be raised. This is by design. There are change events you can use to catch changes in a cell. You can try using CurrentCellChanged to catch all changes, but this event will be raised on each keystroke. If you only want to catch the change as you leave the cell, you can use CurrentCellValidating or CurrentCellAcceptedChanges.


PB Philip Bishop March 8, 2005 02:29 PM

Can you force the dropdown to open upon keystroke? so instead of just bringing that one in view like it does now can you make it be selected and have the drop down open?


AD Administrator Syncfusion Team March 8, 2005 02:50 PM

The method grid.CurrentCell.ShowDropDown will show the dropdown.


PB Philip Bishop March 8, 2005 03:24 PM

Thanks Clay. I just added that to my currentcellchanged event and it works perfect.

Loader.
Live Chat Icon For mobile
Up arrow icon