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.

Custom Drop Down Cell

Thread ID:

Created:

Updated:

Platform:

Replies:

61898 Jun 4,2007 03:28 PM Jun 4,2007 06:22 PM Windows Forms 3
loading
Tags: GridControl
Dan Dorey
Asked On June 4, 2007 03:28 PM

Hi, I'm using v5.

I've created a custom cell (source included below). I've inherited from the combobox and added a new button to it. This button just loads up a custom form that I've created elsewhere. The form is a bit complex and takes 3 seconds to load. When the user clicks on the button in the custom cell an empty listbox appears until the custom form has been created which doesn't look very good. Any idea how I can stop this from happening?

Thanks,
Dan

haneefm [Syncfusion]
Replied On June 4, 2007 03:56 PM

Hi Dan,

You can TableControlCurrentShowingDropDown event to set e.Inner.Handled = true to prevent the showing of the drop-down in a grid cell.

Best regards,
Haneef

Dan Dorey
Replied On June 4, 2007 04:45 PM

Haneef,

This does allow me to prevent the drop down from showing up.

However, I'm unsure how to distinguish between the user clicking the drop down button and my custom button. I still need it to drop down when they click on the drop down button.

Dan



>Hi Dan,

You can TableControlCurrentShowingDropDown event to set e.Inner.Handled = true to prevent the showing of the drop-down in a grid cell.

Best regards,
Haneef

haneefm [Syncfusion]
Replied On June 4, 2007 06:22 PM

Hi Dan,

You can handle the CellButtonClicked event to find the cell button in a grid cell and then set e.Cancel to true to tell the gridControl not to do further processing on the mouse click. And this prevents the showing of the drop-down in a gridcell. Below is a code snippet

private void gridControl1_CellButtonClicked(object sender, GridCellButtonClickedEventArgs e)
{
MyComboBoxCellRenderer cr = this.gridControl1.GetCellRenderer(e.RowIndex,e.ColIndex) as MyComboBoxCellRenderer;
if( cr != null )
{
///// Console.WriteLine("GetType " + e.Button.GetType());
///// if( e.Button is GridCellButton)
if( e.Button.Text == "@")
e.Cancel = true;
}
}

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.

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.

;