SfDataGrid column with ComboBoxAdv

Hi, Is it possible to have a column that has a combobox that acts like ComboBoxAdv? Is there any sample here to show its done?

Thanks,



6 Replies

VS Vijayarasan Sivanandham Syncfusion Team June 28, 2022 04:25 PM UTC

Hi Moustafa,

Solution 1:

SfDataGrid provides support for various built-in column types as GridComboBoxColumn. The GridComboBoxColumn derived from GridColumn which hosts ComboBox as edit element. For more information related to GridComboBoxColumn, please refer the below user guide documentation link,


UG Link: https://help.syncfusion.com/wpf/datagrid/column-types#gridcomboboxcolumn

https://help.syncfusion.com/wpf/datagrid/column-types#create-the-renderer-of-existing-column

Solution 2:


Your requirement to have a column that has a combobox that acts like ComboBoxAdv in SfDataGrid can be achieved by load the ComboBoxAdv as CellTemplate in GridTemplateColumn. Please refer to the below code snippet,


<syncfusion:GridTemplateColumn MappingName="Children" HeaderText="Children">

                    <syncfusion:GridTemplateColumn.CellTemplate>

                        <DataTemplate>

                            <syncfusion:ComboBoxAdv ItemsSource="{Binding Persons,Source={StaticResource viewModel}}"

                                                    DisplayMemberPath="Name" 

                                                    AllowMultiSelect="True"

                                                    AllowSelectAll="True"

                                                    SelectedValueDelimiter=";"

                                                    IsEditable="True"

                                                    DefaultText="Select Childred..."

                                                    SelectedValuePath="Id" />

                        </DataTemplate>

                    </syncfusion:GridTemplateColumn.CellTemplate>

</syncfusion:GridTemplateColumn>


UG Link: https://help.syncfusion.com/wpf/datagrid/column-types#gridtemplatecolumn

Please find the sample in the attachment and let us know if you have any concerns in this.


Regards,

Vijayarasan S


Attachment: Sample_58f4cd65.zip


MO Moustafa June 28, 2022 04:32 PM UTC

Hi Vijayarasan,


I am hoping to get autocomplete and filtering but apparently ComboboxAdv does not support this either. Is there any way to have a combobox column with autocomplete and filtering for the list I select from?



VS Vijayarasan Sivanandham Syncfusion Team June 29, 2022 03:22 PM UTC

Hi Moustafa,

We are currently checking the possibilities to achieve your requirement. We will check and update further details on July 01, 2022.


We appreciate your patience.

Regards,

Vijayarasan S



VS Vijayarasan Sivanandham Syncfusion Team July 1, 2022 04:40 PM UTC

Hi Moustafa,

Your requirement to perform the autocomplete and filtering in ComboBoxAdv by enabling the EnableToken property and AutoCompleteMode as Suggest in ComboBoxAdv. Please refer to the below code snippet,

<syncfusion:GridTemplateColumn  MappingName="Children" Width="200" AllowFiltering="True"  TextWrapping="Wrap" HeaderText="Children" AllowEditing="True" >                  

                    <syncfusion:GridTemplateColumn.CellTemplate>

                        <DataTemplate>

                            <syncfusion:ComboBoxAdv ItemsSource="{Binding Persons,Source={StaticResource viewModel}}"

                                                    DisplayMemberPath="Name" 

                                                    AllowMultiSelect="True"

                                                    AllowSelectAll="True"

                                                    AutoCompleteMode="Suggest"

                                                    SelectedValueDelimiter=";"

                                                    SelectionChanged="OnSelectionChanged"

                                                    IsEditable="True"

                                                    EnableToken="true"

                                                    DefaultText="Select Childred..."

                                                    SelectedValuePath="Id"                                                    

                                                    

                                                    />

                        </DataTemplate>

                    </syncfusion:GridTemplateColumn.CellTemplate>

</syncfusion:GridTemplateColumn>


Please find the sample in the attachment and let us know if you have any concerns in this.


Regards,

Vijayarasan S


Attachment: ComboCheckBoxColumn_dfeb5df8.zip


MO Moustafa July 1, 2022 09:25 PM UTC

Can you please test what you just sent me? It doesnt work. I removed the following because I dont need a multi-select but its bugged and the values I 

                                                   AllowMultiSelect="True"

                                                    AllowSelectAll="True"

                                                    SelectedValueDelimiter=";"




VS Vijayarasan Sivanandham Syncfusion Team July 4, 2022 04:38 PM UTC

Hi Moustafa,

Sorry for the inconvenience caused.

We misunderstood your requirement, please provide more information related to your query?

                1. Provide more details about your scenario with image illustrations

                2. Share the details about your exact requirement on GridComboBoxColumn with the features list

        

Kindly revert to us with the above requested details. It will be more helpful for us to check the possibilities to resolve the reported problem.

Regards,

Vijayarasan S


Loader.
Up arrow icon