Hi,
I'm working with Oradirect 4.75.40.0 with MS Visual Studio 2008.
I'm trying to make the Oradirect.Net sample "MasterDetail" in WPF/C#. As datagrid I use the new Microsoft datagrid component which comes with the WPFToolkit.
I'v createe a strongly typed Dept Emp dataset (OraDirect style, option "use provider specific code generator is checked" is used in dataset wizard.
I'm wondering how I can bind this datagrid. In the Windows Forms sample the grid is bound to the relation. In WPF however, the relation is not exposed as a public property but can be retrieved by means of the relations property of the dataset.
How can I bind this relation to the datagrid?
Regards,
Matthieu de Graaf
Binding master detail datagrid in WPF
-
- Posts: 18
- Joined: Wed 14 May 2008 12:13
Hi,
I've made a little example following the instructions in Beatriz Costas Blog (http://www.beacosta.com/blog/?p=21)
I'v created 2 listboxes. Listbox 1 is based on the dept table in the EmpDeptDS. Listbox 2 is based on the emp_fk_dept relation between the emp en dept table in the EmpDeptDS dataset (column deptno joins the 2 tables)
The Emps are never shown with the dept
Can you show me where I went wrong?
Here you find my (simple code):
XAML File:
0
1
Code behind file:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace EmpDeptMD
{
///
/// Interaction logic for EmpDeptListBoxFM.xaml
///
public partial class EmpDeptListBoxFM : Window
{
private EmpDeptDS myDS = new EmpDeptDS();
public EmpDept.DEPTDataTable myDept;
public EmpDeptListBoxFM()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
myDS.EnforceConstraints = false;
myDept = myDS.DEPT;
this.DataContext = myDept;
myDept.Active = true;
}
}
}
Regards,
Matthieu de Graaf
I've made a little example following the instructions in Beatriz Costas Blog (http://www.beacosta.com/blog/?p=21)
I'v created 2 listboxes. Listbox 1 is based on the dept table in the EmpDeptDS. Listbox 2 is based on the emp_fk_dept relation between the emp en dept table in the EmpDeptDS dataset (column deptno joins the 2 tables)
The Emps are never shown with the dept
Can you show me where I went wrong?
Here you find my (simple code):
XAML File:
0
1
Code behind file:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace EmpDeptMD
{
///
/// Interaction logic for EmpDeptListBoxFM.xaml
///
public partial class EmpDeptListBoxFM : Window
{
private EmpDeptDS myDS = new EmpDeptDS();
public EmpDept.DEPTDataTable myDept;
public EmpDeptListBoxFM()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
myDS.EnforceConstraints = false;
myDept = myDS.DEPT;
this.DataContext = myDept;
myDept.Active = true;
}
}
}
Regards,
Matthieu de Graaf