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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Dropdowngrid and popup menu

Thread ID:

Created:

Updated:

Platform:

Replies:

46443 Jul 13,2006 05:49 AM UTC Aug 5,2006 11:56 AM UTC Windows Forms 11
loading
Tags: GridControl
Christian Lützenkirchen
Asked On July 13, 2006 05:49 AM UTC

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

Administrator [Syncfusion]
Replied On 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

Administrator [Syncfusion]
Replied On 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

Christian Lützenkirchen
Replied On 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

Administrator [Syncfusion]
Replied On 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

Christian Lützenkirchen
Replied On 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

Administrator [Syncfusion]
Replied On 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

Christian Lützenkirchen
Replied On 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

Administrator [Syncfusion]
Replied On 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

Christian Lützenkirchen
Replied On 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

Administrator [Syncfusion]
Replied On 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

Christian Lützenkirchen
Replied On 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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;