This solution i experienced. when i develop wpf application there i used combobox. when i try to add new student that time combobox items not reloaded. because of application loading time i loaded dynamically. so i don't no how to refresh the combobox list. After that i got this solution. when u add new item while after "objwindow.ShowDialog()" refresh the combobox.

 <ComboBox Name="Student" ItemsSource="{Binding Source={StaticResource Students}, XPath=Student/@StudentName}"
SelectionChanged="{pti:DelegateCreator student_Changed}" MinWidth="150"
Style="{StaticResource RequiredComboBox}" />
if you want to refresh from the controller your combobox name declare commonly like
ComboBox _studentList = FindLogicalNode(window, STUDENT_LIST) as ComboBox;
other wise your refresh from the xaml.cs file there your can declare like "this.FindResource"
private static void studentConfig_Click(object source, RoutedEventArgs args)
        {
            StudentConfiguration objwindow = new StudentConfiguration();
            objwindow.ShowDialog();
            (_studentList.FindResource("Students") as XmlDataProvider).Refresh();            
        }

0 comments

Related Posts Plugin for WordPress, Blogger...