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

DropDownUserCell and selectively disabling popup at runtime

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.


2 Replies

HA haneefm Syncfusion Team May 15, 2007 11:49 PM UTC

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


JB James Blibo May 16, 2007 08:13 PM UTC

works like a charm... thx

Loader.
Live Chat Icon For mobile
Up arrow icon