DataGrid GridComboBoxColumn

Hi,

I try to get GridComboBoxColum to work but without success. I get succssfull data from database in  

ObservableCollection. This one is binded in XAML but ComboBox is empty.  I think i have read each thread in forum, but i don't get work. 

I search for example to get work ComboBox from Database in Grid.

Thanks !

Greetings Ljuban

Model.cs:

    public string PLANEINHEIT

        {

            get => _planEinheit;

            set { _planEinheit = value; RaisePropertyChanged("PLANEINHEIT"); }

        }

ModelView:

PlaneinheitList = new ObservableCollection<PlaneinheitModel>();

//DataTable was fill from Database

if (_dtPlanEinheit.Rows.Count > 0)

            {

                foreach (DataRow dr in _dtPlanEinheit.Rows)

                {

                    PlaneinheitList.Add(new PlaneinheitModel() { PLANEINHEIT = dr[0].ToString().Trim() });

                }

            }

main.xaml

 <syncfusion:GridComboBoxColumn

                            Width="100"

                            AllowEditing="True"

                            ItemsSource="{Binding PlaneinheitList}"

                            AllowSorting="True"

                            ColumnSizer="Star"

                            HeaderText="Planeinheit"

                            ImmediateUpdateColumnFilter="True"

                            MappingName="PLANEINHEIT" />



1 Reply

VS Vijayarasan Sivanandham Syncfusion Team December 2, 2021 01:46 PM UTC

Hi Ljuban Magdelinic,

Thank you for contacting Syncfusion Support.

Based on provided information we have prepared the sample for achieve your requirement. 

Sample Link: https://www.syncfusion.com/downloads/support/forum/170857/ze/SfDataGridDemo-147061653

For more information related to GridComboBoxColumn, please refer the below user guide documentation link, 


Regards, 
Vijayarasan S 


Loader.
Up arrow icon