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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Dropdown grid and modal dialog

Thread ID:

Created:

Updated:

Platform:

Replies:

48111 Aug 20,2006 06:20 AM UTC Nov 8,2006 09:26 AM UTC WinForms 7
loading
Tags: GridControl
Christian Lützenkirchen
Asked On August 20, 2006 06:20 AM UTC

Hi,

how can I display a modal dialog when I press a button in a dropdown grid? I attached a sample base on the AdvancedTabbedMDI_Sample. Please drop down the cell A2. In this dropdown grid press the button in cell A1. A modal dialog is shown where I want to select a value for cell A1. When I activate this dialog the dropdown cell is closed. I tried different controls as parameter for ShowDialog() but I had no success. I tried to set the dialog as topmost but no success, too. When I do not set the dialog as topmost it is drawn behind the dropdown grid.

Any Ideas?

Regards,
Christian


DropDownGrid21.zip

Administrator [Syncfusion]
Replied On August 21, 2006 07:36 AM UTC

Hi Christian,

Try the code below in the CurrentCellCloseDropDown event handler.

private void gridControl1_CurrentCellShowedDropDown(object sender, System.EventArgs e)
{
if (e.PopupCloseType == Syncfusion.Windows.Forms.PopupCloseType.Deactivated)
{
this.gridControl1.CurrentCell.ShowDropDown();
}
}

Here is the modified sample
http://www.syncfusion.com/Support/user/uploads/DropDownGrid3_cd0498a4.zip

Let me know if this helps.
Thanks,
Rajagopal

Christian Lützenkirchen
Replied On August 21, 2006 05:51 PM UTC

Hi Rajagopal,

thank you for your sample but it does not work properly. It has the following problems:

* When you click in the middle or the modal dialog the dropdown grid is drawn in front of the dialog
* The the modal dialog should not be topmost, only modal to the application. The dropdown grid seems to bee topmost, too. If you move another application over the grid it is drawn behind the two windows.

Do you have any other ideas?

Regards,
Christian

Administrator [Syncfusion]
Replied On August 23, 2006 09:26 AM UTC

Hi Christian,

Issue 1:

Do you want to show the form without losing the grid focus? If so, Please refer to the browser sample \In depth\DropDownFormAndUserControlSample shows how you can popup a Form from a grid cell.

Here is a modified sample for implementing it.
http://www.syncfusion.com/Support/user/uploads/DropDownGridModified_8014af69.zip

Issue 2:

Try setting the TopMost property of the ModalDialog form to false in ModalDialog''s load event. Below code snippet.

void ModalDialog_Load(object sender, EventArgs e)
{
this.TopMost = false;
}

Also refer the below forum thread for customize the DropDown cell.
http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=48072

Let me know if this helps.
Best Regards,
Haneef

Christian Lützenkirchen
Replied On August 24, 2006 08:22 AM UTC

Hi Haneef,

thank you for your sample. It works better but there are still two issues.

* Can I prevent the dropdown grid from flashing each time I click on the modal dialog? The modal dialog is flashing too when I click on the dropdown grid. Is it possible to stop this flashing, too? The Problem is gridControl1_CurrentCellCloseDropDown. There is no Cancel member in PopupClosedEventArgs. Is there any other way to forbid closing earlier?

* The dropdown grid ist always topmost, so the modal dialog is always topmost even if the topmost-flag is set to false. If I move another window over the application it is drawn between the main grid and the dropdown grid...

Regards,
Christian

Christian Lützenkirchen
Replied On August 31, 2006 06:12 AM UTC

Hi Haneef,

any ideas?

Regards,
Christian

Christian Lützenkirchen
Replied On November 7, 2006 01:10 PM UTC

Hi Haneef,

I did not find any solution mean while. Do you have any ideas?

Regards,
Christian

Administrator [Syncfusion]
Replied On November 8, 2006 09:26 AM UTC

Hi Christian,

You can avoid this by handling the PopupContainer.BeforeCloseUp event by registering it in the OnShowDropDown override. Please have a look at the modified sample for more details.

//Some code snippet...
//the dialog forms flickering is the default behavior.
protected override void OnShowDropDown()
{
base.OnShowDropDown();
this.PopupControlContainer.BeforeCloseUp += new CancelEventHandler(PopupControlContainer_BeforeCloseUp);
}

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

Best Regards,
Haneef

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

;