1
Answer

Databind a dataContext on another Xaml window?

akpaga akpaga

akpaga akpaga

11y
1.3k
1
In my main window.xaml i have a button which opens searchwindow.xaml

 private void Search_Click(object sender, RoutedEventArgs e)
  {

 
 

  if (dt.Rows.Count > 0)
  {
 
  new SearchWindow(){DataContext = dt.DefaultView}.Show();
  }

  }

In the searchWindow.Xaml is there is button 'BIND' and  a datagrid .  I want to databind the data grid with the dat context table that has been sent from MainWindow.xaml  on clicking the BIND button...How can i do it...Thank you
Answers (1)