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.
Syncfusion Feedback

Prevent selection of next item on combobox cell doubleclick?

Thread ID:

Created:

Updated:

Platform:

Replies:

96669 Sep 27,2010 01:09 PM UTC Oct 6,2010 01:09 PM UTC ASP.NET Web Forms (Classic) 2
loading
Tags: GridGroupingControl
Maxim Software Systems
Asked On September 27, 2010 01:09 PM UTC

Is there a way to prevent a grid cell whose CellType is "ComboBox" from selecting the next item in its DataSource when the cell is double-clicked?


Maxim Software Systems
Replied On September 28, 2010 03:41 PM UTC

Sorry, I didn't realize this was under the ASP.NET forums.


Nirmal Raja [Syncfusion]
Replied On October 6, 2010 01:09 PM UTC

Hi,

Thank you for your interest in Syncfusion products.

The double clicking of the combo box cell which changes the values can be canceled by overriding the OnEditPartMouseDown and OnDoubleClick from the GridComboBoxCellRenderer, then add the renderer to the current grid's combo box cell renderer.

Please refer the code below:
//Assigning the custome renderer
gridControl1.CellRenderers["ComboBox"] = new CustomDropDownRenderer(gridControl1, gridControl1.CellModels["ComboBox"]);

//The custome renderer class
public class CustomDropDownRenderer : GridComboBoxCellRenderer
{
public CustomDropDownRenderer(GridControlBase grid, GridCellModelBase model)
: base(grid, model)
{
}
protected override void OnEditPartMouseDown(object sender, MouseEventArgs e)
{
//base.OnEditPartMouseDown(sender, e);
}
protected override void OnDoubleClick(int rowIndex, int colIndex, MouseEventArgs e)
{
//base.OnDoubleClick(rowIndex, colIndex, e);
}
}

Also please refer the sample modified from our sample browser attached below, which illustrates the mentioned behavior:
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=DropDownSelection-131758482.zip

Let me know if you have any queries.

Regards,
Nirmal


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

;