Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Programmatically Dropping down list doesn't always work
posted

When ever i drop down a list the first time it seems to work. this is usually on some error in the data that is validated whenever the grid looses focus. i an using the following code.

 grid.Focus();

UltraGridCell cell = grid.Rows[i].Cells["Relation"];

Application.DoEvents();if (!cell.Activated)

cell.Activate();

grid.PerformAction(
UltraGridAction.EnterEditMode);

cell.EditorResolved.DropDown();

 

I have also tried the following as well with the same result

 grid.Focus(); 

UltraGridCell cell = grid.Rows[i].Cells["Relation"];

Application.DoEvents();

if (!cell.Activated)

cell.Activate();

grid.PerformAction(UltraGridAction.EnterEditModeAndDropdown);

 

both work the first time, after that it only selects the cell, and doesn't drop down the editor. I am using version 6.2, so if this was a known issue, and has been corrected in a new version, and an upgrade will fix it great or if i need to do something else, that would be great too.

Some more background info that may be helpful is as follows:

1. Code is implemented with in the grid leave event.

2. i loop though the rows to find the row with a listItem that matches my business object.

3. the dropdown is of a business enum type.

4. I do not have any datatype issues with the enum, all selection and updating works propertly.