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

SfDataGrid as a Popup fo ComboBox

Can we set SfDataGrid to autosize in Popup Container Control , according to the number of shown rows. to get the same behavior as a default popup.

I want to use it as a custom popup for ComboBox ,taking advantage of the grouping and filtering properties.

ex :sync.jpg


4 Replies

SJ Sathiyathanam Jeyakumar Syncfusion Team February 28, 2023 02:05 PM UTC

Hi ehs psy,

We suspect that you would like to display the SfDataGrid inside the ComboBox popup container. Unfortunately, this is not currently supported in Syncfusion controls. However, we do have a MultiColumnComboBox control that allows you to display multiple columns in a ComboBox dropdown list. Refer the below UG Links.


https://help.syncfusion.com/windowsforms/multicolumn-combobox/overview


If we misunderstood your scenario, please provide us with more information regarding your requirement.


Regards

Sathiyathanam



EP ehs psy March 1, 2023 08:34 AM UTC

Hi  Sathiyathanam ,

the  MultiColumnComboBox doesn't allow grouping,my list is very long.




SJ Sathiyathanam Jeyakumar Syncfusion Team March 2, 2023 05:51 PM UTC

ehs psy,

We regret to inform you that the MultiColumnComboBox does not contain the SfDataGrid in its popup container, and we are unable to perform grouping with the MultiColumnComboBox. We are currently investigating your scenario from our end, and we will update you with further details on March 6, 2023.



SJ Sathiyathanam Jeyakumar Syncfusion Team March 6, 2023 12:40 PM UTC

ehs psy,

Your requirement can be fulfilled by using the ComboDropDown control, which allows you to set the SfDataGrid as a PopupControl of the ComboDropDown. Refer to the below code snippets and a sample to get more information.

UG Link : https://help.syncfusion.com/windowsforms/combobox-dropdown/getting-started#through-code

this.comboDropDown1.BeforeTouchSize = new System.Drawing.Size(121, 28);

this.comboDropDown1.DropDownWidth = 600;

this.comboDropDown1.Location = new System.Drawing.Point(38, 46);

this.comboDropDown1.Name = "comboDropDown1";

this.comboDropDown1.PopupControl = this.sfDataGrid1;

 

this.comboDropDown1.Size = new System.Drawing.Size(121, 28);

this.comboDropDown1.TabIndex = 0;

this.Controls.Add(this.comboDropDown1);



Let us know if you need any further assistance on this.


Attachment: WindowsFormsApp1_e0a9fb52.zip

Loader.
Live Chat Icon For mobile
Up arrow icon