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.

DropDownUserCell and selectively disabling popup at runtime

Thread ID:

Created:

Updated:

Platform:

Replies:

60924 May 15,2007 10:56 AM May 16,2007 04:13 PM Windows Forms 2
loading
Tags: Grouping
James Blibo
Asked On May 15, 2007 10:56 AM

I have a cell that is a DropDownUserCell. How can I at runtime enable and disable this control.
In the disabled state, I do not want the dialog to popup or show.

I tried cancel the event in...

TableControlCurrentCellShowingDropDown

but that doesn't work becuase I guess the drop down isn't a standard combobox.


haneefm [Syncfusion]
Replied On May 15, 2007 07:49 PM

Hi James,

You can override the DropDownContainerShowingDropDown method of the DropDownUserCellRenderer class and call RaiseCurrentCellShowingDropDown method that allows for an event that might cancel the drop or set its size. Below is a code snippet.

public override void DropDownContainerShowingDropDown(object sender, CancelEventArgs e)
{
GridCurrentCell cc = this.Grid.CurrentCell;

Size size = ddUser.Size;
GridCurrentCellShowingDropDownEventArgs ce = new GridCurrentCellShowingDropDownEventArgs(size);
Grid.RaiseCurrentCellShowingDropDown(ce);
if (ce.Cancel)
{
e.Cancel = true;
return;
}
ddUser.Size = ce.Size;

this.DropDownContainer.Size = ddUser.Size;
this.ddUser.SetValuesFromString(this.ControlText);
ddUser.Visible = true;
}

You can cancel the drop-down window by setting the e.Cancel property to false in a CurrentCellShowingDropDown event.

Best regards,
Haneef

James Blibo
Replied On May 16, 2007 04:13 PM

works like a charm... thx

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.

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.

;