ComboBox field not opening in one click

Hi !

I'm using SFDatagGrid with a ComboBox field and everything runs 100%.

But, to get all options open when user clicks on the field, I set the same code as mentioned in documentation, as shown below:

Me.sfDataGrid.CellRenderers.Remove("ComboBox")
Me.sfDataGrid.CellRenderers.Add("ComboBox", New GridComboBoxCellRendererExt())

Public Class GridComboBoxCellRendererExt
	Inherits GridComboBoxCellRenderer
	Protected Overrides Sub OnInitializeEditElement(ByVal column As DataColumnBase, ByVal rowColumnIndex As RowColumnIndex, ByVal uiElement As SfComboBox)
		MyBase.OnInitializeEditElement(column, rowColumnIndex, uiElement)
		uiElement.ShowDropDown()
	End Sub
End Class
But, unfortunately, the combo does not open in 1-click mode...  If I do a double-click on it, ok, the options open.

Do you know what am I doing wrong?

I appreciate in advance for any help.







3 Replies 1 reply marked as answer

VS Vijayarasan Sivanandham Syncfusion Team June 16, 2020 02:50 PM UTC

Hi DavidBS,

Thank you for contacting Syncfusion support.

Your requirement can be achieved by set the SingleClick value as EditMode property in SfDataGrid. Please refer the below code snippet,
 
orderInfo = new OrderInfoCollection(); 
            
this.sfDataGrid1.EditMode = EditMode.SingleClick; 
this.sfDataGrid1.DataSource = orderInfo.OrdersListDetails; 
this.sfDataGrid1.AutoSizeColumnsMode = AutoSizeColumnsMode.Fill; 
this.sfDataGrid1.Columns.Add(new GridNumericColumn() { MappingName = "OrderID", HeaderText = "Order ID"});           
 this.sfDataGrid1.Columns.Add(new GridCheckBoxColumn() { MappingName = "IsClosed", HeaderText = "Closed", AllowCheckBoxOnHeader = true, CheckBoxSize = new Size(13, 13), Width = 100 }); 
this.sfDataGrid1.Columns.Add(new GridComboBoxColumn() { MappingName = "ShipCityID", HeaderText = "Ship City", DisplayMember = "ShipCityName", ValueMember = "ShipCityID", DropDownStyle = DropDownStyle.DropDownList, DataSource = orderInfo.ShipCityDetails }); 
this.sfDataGrid1.Columns.Add(new GridMultiSelectComboBoxColumn() { MappingName = "Products", HeaderText = "Products", DisplayMember = "ProductName", ValueMember = "ProductName", DataSource = orderInfo.ProductDetails }); 
 
this.sfDataGrid1.CellRenderers.Remove("ComboBox"); 
this.sfDataGrid1.CellRenderers.Add("ComboBox", new GridComboBoxCellRendererExt()); 
 
 


Marked as answer

DA DavidBS June 17, 2020 06:17 PM UTC

Thank you very much Vijayarasan S!

It worked like a charm.

Kindest regards,
David


VS Vijayarasan Sivanandham Syncfusion Team June 18, 2020 05:22 AM UTC

Hi DavidBS,

Thanks for the update.

We are glad to know that the reported issue has been resolved. Please get back to us if you have any other queries. As always, we will happy to assist you
😊

Regards,
Vijayarasan S



Loader.
Up arrow icon