@@ -65,13 +65,13 @@ The following table describes the types of columns and their usage:
6565<td >{{'[DataGridComboBoxColumn](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.DataGridComboBoxColumn.html)'| markdownify }}</td >
6666<td >{{'[DataGridComboBoxRenderer](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.DataGridComboBoxRenderer.html)'| markdownify }}</td >
6767<td >ComboBox</td >
68- <td >To display a combo box control for selecting items from a predefined list.</td >
68+ <td >To display a combo box control for selecting item from a predefined list.</td >
6969</tr >
7070<tr >
7171<td >{{`DataGridPickerColumn`| markdownify }}</td >
7272<td >{{'[DataGridPickerCellRenderer]'| markdownify }}</td >
7373<td >Picker</td >
74- <td >To display a picker control for selecting items from a predefined list.</td >
74+ <td >To display a picker control for selecting item from a predefined list.</td >
7575</tr >
7676<tr >
7777<td >{{'[DataGridUnboundColumn](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.DataGridUnboundColumn.html)'| markdownify }}</td >
@@ -1040,25 +1040,25 @@ To load the `DataGridPickerColumn` with a simple string collection, you can refe
10401040 </ContentPage.BindingContext>
10411041
10421042 <sfGrid:SfDataGrid x:Name="dataGrid"
1043- ItemsSource="{Binding OrderInfoCollection}">
1043+ ItemsSource="{Binding DealerInformation}"
1044+ AllowEditing="True">
10441045 <sfGrid:SfDataGrid.Columns>
1045- <sfGrid:DataGridPickerColumn BindingContext="{x:Reference viewModel}"
1046- HeaderText="Name"
1047- ItemsSource="{Binding CustomerNames}"
1048- MappingName="DealerName" />
1046+ <sfgrid:DataGridPickerColumn HeaderText="Ship Country"
1047+ MappingName="ShipCountry"
1048+ ItemsSource="{Binding Countries}"/>
10491049 </sfGrid:SfDataGrid.Columns>
10501050 </sfGrid:SfDataGrid>
10511051{% endhighlight %}
10521052
10531053{% highlight c# %}
1054- dataGrid = new SfDataGrid();
1054+ SfDataGrid dataGrid = new SfDataGrid();
1055+ dataGrid.ItemsSource = viewModel.DealerInformation;
1056+ dataGrid.AllowEditing = true;
10551057DataGridPickerColumn pickerColumn = new DataGridPickerColumn()
10561058{
1057- BindingContext = viewModel,
1058- MappingName = "DealerName",
1059- ItemsSource = viewModel.CustomerNames,
1060- HeaderText = "Name"
1061-
1059+ MappingName = "ShipCountry",
1060+ HeaderText = "Ship Country",
1061+ ItemsSource = viewModel.Countries
10621062};
10631063dataGrid.Columns.Add(pickerColumn);
10641064{% endhighlight %}
@@ -1069,15 +1069,67 @@ dataGrid.Columns.Add(pickerColumn);
10691069
10701070public class ViewModel
10711071{
1072- public ObservableCollection<string > CustomerNames { get; set; }
1072+ public ObservableCollection<DealerInfo > DealerInformation { get; set; }
1073+ public ObservableCollection<string > Countries { get; set; }
10731074
10741075 public ViewModel()
10751076 {
1076- this.CustomerNames = Customers .ToObservableCollection();
1077+ this.Countries = this.shipCountry .ToObservableCollection();
10771078 }
10781079
1079- internal string[] Customers = new string[] {"Adams","Crowley","Ellis","Gable","Irvine","Keefe","Mendoza","Owens","Rooney","Wadded",};
1080-
1080+ private string[] shipCountry = new string[]
1081+ {
1082+ "Argentina",
1083+ "Austria",
1084+ "Belgium",
1085+ "Brazil",
1086+ "Canada",
1087+ "Denmark",
1088+ "Finland",
1089+ "France",
1090+ "Germany",
1091+ "Ireland",
1092+ "Italy",
1093+ "Mexico",
1094+ "Norway",
1095+ "Poland",
1096+ "Portugal",
1097+ "Spain",
1098+ "Sweden",
1099+ "UK",
1100+ "USA",
1101+ };
1102+ }
1103+ public class DealerInfo : INotifyPropertyChanged
1104+ {
1105+ #region Properties
1106+ private string shipCountry;
1107+
1108+ public event PropertyChangedEventHandler? PropertyChanged;
1109+ public string ShipCountry
1110+ {
1111+ get
1112+ {
1113+ return this.shipCountry;
1114+ }
1115+
1116+ set
1117+ {
1118+ this.shipCountry = value;
1119+ this.RaisePropertyChanged("ShipCountry");
1120+ }
1121+ }
1122+ #endregion
1123+
1124+ #region INotifyPropertyChanged implementation
1125+ private void RaisePropertyChanged(string name)
1126+ {
1127+ if (this.PropertyChanged != null)
1128+ {
1129+ this.PropertyChanged(this, new PropertyChangedEventArgs(name));
1130+ }
1131+ }
1132+ #endregion
10811133}
10821134{% endhighlight %}
10831135{% endtabs %}
0 commit comments