I have a problem with databinding. I made 2 datagrid. The 1st is a general WPF dagrid the 2nd is dxgrid control.
Both show the datas through entity framework.
I wanted to bind a current row to a texbox. If I click the row in a 1st table is working well and the data is showing in the textbox, but in the 2nd grid control not working.
What cause the problem?
This is the XAML code:
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="685" Width="895" Loaded="Window_Loaded" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:my="clr-namespace:Valinor" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid">
This is a c# code:
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
Valinor.ValinorEntities valinorEntities = new Valinor.ValinorEntities();
System.Windows.Data.CollectionViewSource itemsViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("itemsViewSource")));
System.Data.Objects.ObjectQuery
itemsViewSource.Source = itemsQuery.Execute(System.Data.Objects.MergeOption.AppendOnly);
}
private System.Data.Objects.ObjectQuery
{
System.Data.Objects.ObjectQuery
return itemsQuery;
}
}
kible hanaPosted Apr 3, 2012, 8:09 AM