Hi
I want to bind values to my
and I "fly"
this is my code
when I bind the data to the Combo from a
Thanks
I want to bind values to my
GridViewComboBoxColumn
from a DataTableand I "fly"
this is my code
| <telerik:RadGridView.Columns> |
| <telerik:GridViewComboBoxColumn |
| DataMemberBinding="{Binding Path=UnitName}" |
| DisplayMemberPath="Name" |
| SelectedValueMemberPath="ID" |
| HeaderText="שם היחידה" |
| UniqueName="UnitName" Width="120" /> |
| </telerik:RadGridView.Columns> |
| </telerik:RadGridView> |
| DataTable dt = new DataTable(); |
| dt.Columns.Add("UnitName",typeof(int)); |
| dt.Rows.Add(1); |
| dt.Rows.Add(2); |
| ((GridViewComboBoxColumn)this.gvLoadingCustomers.Columns["UnitName"]).ItemsSource = GetUnits(); |
| gvLoadingCustomers.ItemsSource = dt.DefaultView; |
| private DataView GetUnits() |
| { |
| DataTable dt = new DataTable(); |
| dt.Columns.Add("Id", typeof(int)); |
| dt.Columns.Add("Name", typeof(string)); |
| dt.Rows.Add(1,"חטיבה בנקאית"); |
| dt.Rows.Add(2,"חטיבה מסחרית"); |
| dt.Rows.Add(3,"חטיבה עסקית"); |
| dt.Rows.Add(4,"GPB"); |
| dt.Rows.Add(5,"מת''מ"); |
| return dt.DefaultView; |
| } |
when I bind the data to the Combo from a
System.Collections.
IEnumerable
it works, but when I use a dataTable it fail...
Thanks