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
close icon

Dropdowngrid and popup menu

Hi, I have some problems using popup menus with a dropdowngrid cell. I am using a popupmenu in the grid and each dropdown grid. The problems are: 1. The popupmenu in the dropdowngrid does not close when I click into the grid. It is only closed when I leave this grid. 2. I am using the UpdateUI event. In this event I have to choose, in which grid I am currently, the parent or the dropdown. How can I query this? Please refer to my sample. Regards Christian

Dropdowngrid0.zip

11 Replies

AD Administrator Syncfusion Team July 13, 2006 11:06 AM UTC

Hi Christian, 1. I was able to see the mentioned problem here, I will discuss it with our tools team and let you know if this is a bug. 2. To determine the current grid in the UpdateUI event, you can have a flag, set it to true in the CurrentCellShowedDropDown event of the main grid and set the flag back to false in the CurrentCellCloseDropDown event. Refer to the code below. bool flag = false; // CurrentCellShowedDropDown event of main grid flag = true; // CurrentCellCloseDropDown event of main grid flag = false; private void OnUpdateUI(object sender, EventArgs e) { if(flag) Console.WriteLine("In DropDown Grid"); else Console.WriteLine("In Parent Grid"); } Thanks, Rajagopal


AD Administrator Syncfusion Team July 19, 2006 09:01 AM UTC

Hi Christian,

Sorry for the delay in getting back to you. You can workaround this problem by adding this event handler and activating the form when the popup occured.

this.popupMenu1.ParentBarItem.Popup += new EventHandler(ParentBarItem_Popup);

private void ParentBarItem_Popup(object sender, EventArgs e)
{
this.Activate();
}

Here is a sample
Dropdowngrid1.zip


Thanks,
Rajagopal


CL Christian Lützenkirchen July 29, 2006 06:07 AM UTC

Hi Rajagopal,

thank you for your sample. It works fine in an SDI-application but not for a MDI-child. Please see the attached sample.

Regards,
Christian

DropDownGrid2.zip


AD Administrator Syncfusion Team July 31, 2006 06:21 AM UTC

Hi Christian,

Thanks for your update.

Use this code snippet to activate the grid when the popup occured in a popup control.

private void ParentBarItem_Popup(object sender, EventArgs e)
{
this.gridControl1.Focus();
}

Let me know if this helps.
Best Regards,
Haneef


CL Christian Lützenkirchen July 31, 2006 07:26 AM UTC

Hi Haneef,

thank you for your reply, but this sample doesn''t work. When I focus the grid the dropdown grid closes on popup. When I focus the dropdown grid the popup menu does not close. Do you have another idea?

Regards,
Christian


AD Administrator Syncfusion Team July 31, 2006 09:38 AM UTC

Hi Christian,

Sorry for the inconvenience. The sample works fine for me, and I am not able to see the mentioned issue here. I have attached the sample here. Can you able to see the issue in the attached sample? Or can you please tell me how to reproduce the issue in the attached sample so that we can get back soon with a solution at the earliest.

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/DropDownGrid2_a9a44d36.zip

Please let me know about the current version of Essential Studio/.Net FrameWork you are using.

Thanks for your patience.
Regards,
Haneef


CL Christian Lützenkirchen July 31, 2006 10:42 AM UTC

Hi Haneef,

your sample works fine to me, too. In my application I still have this strange behaviour. The popup works fine when the dropdown grid is in edit mode. The grid runs in virtual mode. When I call Focus() the grid queries row height and col width. Perhaps this is the cause!?! I will analyse this behaviour in my application...
Do you have any other ideas?

Regards,
Christian


AD Administrator Syncfusion Team July 31, 2006 12:01 PM UTC

Hi Christian,

You can handle the CurrentCellActivating event in the DropDownGridCellRenderer.Grid control and set the Focus to the parent grid and child grid. Please find the code snippet below.

//File #[DropDownGridCell.cs]

public class DropDownGridCellRenderer: GridDropDownGridCellRenderer
{

protected override Control CreateInnerControl(out GridControlBase grid)
{
grid = this.grid;
grid.CurrentCellActivating += new GridCurrentCellActivatingEventHandler(grid_CurrentCellActivating);
grid.Dock = DockStyle.Fill;
grid.CausesValidation = false;
return grid;
}

void grid_CurrentCellActivating(object sender, GridCurrentCellActivatingEventArgs e)
{
this.PopupControlContainer.FocusParent();
grid.Focus();
}

}

Let me know if this helps.
Best Regards,
Haneef


CL Christian Lützenkirchen August 3, 2006 08:11 AM UTC

Hi Haneef,

thank you for your sample. It works fine except one little problem. The grid in the popup container does not cover the whole area of the conainer. When you click into a grid cell after the popup is shown, the popup is closed correctly. When you click into the area at the bottom of the grid in the popup container, the menu is still not closed.

Best Regards,
Christian


AD Administrator Syncfusion Team August 3, 2006 11:11 AM UTC

Hi Christian,

I am not able to see this problem happening here, the popup menu gets closed properly when you click into the area at the bottom of the grid in the popup container. Attached is a sample that works fine, please check this. Can you please provide us some relevant screen shots showing the problem.
DropDownGrid21.zip

Thanks,
Rajagopal


CL Christian Lützenkirchen August 5, 2006 11:56 AM UTC

Hi Rajagopal, hi Haneef

thank you for your sample. Now I found the solution:

* Your last sample works fine because you added this.gridControl1.Focus() to ParentBarItem_Popup(). I didn''t include this because of a strange behaviour in my application (see 7/31/2006 3:26:16 AM )

* The solution of Haneef using the CurrentCellActivating event does not work. The event is only fired when you are in the grid. This is the cause for my last problem (8/3/2006 4:11:13 AM )

* The solution is not using the grid.CurrentCellActivating event but the grid.Click event. It is fired in and out of the grid and focuses the grid.

Thank you very much for your help!!! It would be nice if you fix this behaviour in the next release of the library.

Best Regards,
Christian

Loader.
Live Chat Icon For mobile
Up arrow icon