hi,
I am binding datatable dataview to combobox.itemssource.
When i run in the combobox dropdown the items populated are system.data.datarowview instead of the value of po_no.
To work around this problem i set path as po_no
Now the combobox items are populated by values of po_no but selectedvalue is not set when i select a combobox item its always null.
Can anyone plz help me with this.
Thank u
Raghu
mjk pradeepPosted Apr 29, 2010, 10:51 PM
namespace comboboxDemo
{
///
/// Interaction logic for MainWindow.xaml
///
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
Loaded += new RoutedEventHandler(MainWindow_Loaded);
}
void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
poNoComboBox.DataContext = new MyClass[]
{
new MyClass{id=1,name="rob"},
new MyClass{id=2,name="bob"},
new MyClass{id=3,name="cob"},
new MyClass{id=4,name="pob"},
};
}
}
class MyClass
{
public int id { get; set; }
public string name { get; set; }
}
}
XAML