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

Custom Drop Down Cell

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

3 Replies

HA haneefm Syncfusion Team June 4, 2007 07:56 PM UTC

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


DD Dan Dorey June 4, 2007 08:45 PM UTC

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


HA haneefm Syncfusion Team June 4, 2007 10:22 PM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon