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 04:45 PM UTC

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 05:24 PM UTC

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 06:26 PM UTC

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 07:03 PM UTC

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 07:17 PM UTC

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 07:29 PM UTC

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 07:50 PM UTC

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


PB Philip Bishop March 8, 2005 08:24 PM UTC

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

Loader.
Up arrow icon