PageRenderTime 21ms CodeModel.GetById 17ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Visual Studio 2008/CSWPFCascadeDataGridComboBoxColumns/Readme.txt

#
Plain Text | 54 lines | 36 code | 18 blank | 0 comment | 0 complexity | bfbf645ca4a3212a0ca3aef396c80d63 MD5 | raw file
 1================================================================================
 2       WPF Cascade DataGridcomboBoxColumn Project Overview                        
 3===============================================================================
 4
 5/////////////////////////////////////////////////////////////////////////////
 6Use:
 7
 8The sample demonstrates how to show cascade data in the loop up list in two DataGrid 
 9combobox columns.
10   
11/////////////////////////////////////////////////////////////////////////////
12Prerequisites:
13
14You need to install WPF toolkit on your machine before running this sample.
15Visit the following link to get WPF toolkit:
16http://wpf.codeplex.com/
17
18/////////////////////////////////////////////////////////////////////////////
19Demo:
20
21Step1. Build the sample project in Visual Studio 2008.
22
23Step2. Select "China" in the first column, and click the cell under the second
24column in the same row. You'll see two items "Beijing" and "Shanghai" in the
25drop down list of the ComboBox.
26
27Step3. Select "UnitedStates" in the first column, and click the cell under the second
28column in the same row. You'll see two items "NewYork" and "Washington" in the
29drop down list of the ComboBox.
30
31/////////////////////////////////////////////////////////////////////////////
32Code Logic:
33
34Firstly, bind the first column to the parent data source and bind the second 
35column to the whole child data source. 
36
37In order to show cascade look up list in the second column, handle its 
38PreparingCellEditing event to get the hosted editing element, in this case a 
39ComboBox. 
40
41Then rebind the ComboBox so as to show the corresponding child data in the 
42ComboBox's drop down list.
43
44
45/////////////////////////////////////////////////////////////////////////////
46References:
47
48http://windowsclient.net/wpf/wpf35/wpf-dg-preview-ctrl-investments.aspx
49http://windowsclient.net/wpf/wpf35/wpf-video-datagrid-ctp-preview.aspx 
50http://windowsclient.net/wpf/wpf35/wpf-35sp1-toolkit-datagrid-feature-walkthrough.aspx  
51
52/////////////////////////////////////////////////////////////////////////////
53
54