PageRenderTime 41ms CodeModel.GetById 17ms RepoModel.GetById 0ms 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. Use:
  6. The sample demonstrates how to show cascade data in the loop up list in two DataGrid
  7. combobox columns.
  8. /////////////////////////////////////////////////////////////////////////////
  9. Prerequisites:
  10. You need to install WPF toolkit on your machine before running this sample.
  11. Visit the following link to get WPF toolkit:
  12. http://wpf.codeplex.com/
  13. /////////////////////////////////////////////////////////////////////////////
  14. Demo:
  15. Step1. Build the sample project in Visual Studio 2008.
  16. Step2. Select "China" in the first column, and click the cell under the second
  17. column in the same row. You'll see two items "Beijing" and "Shanghai" in the
  18. drop down list of the ComboBox.
  19. Step3. Select "UnitedStates" in the first column, and click the cell under the second
  20. column in the same row. You'll see two items "NewYork" and "Washington" in the
  21. drop down list of the ComboBox.
  22. /////////////////////////////////////////////////////////////////////////////
  23. Code Logic:
  24. Firstly, bind the first column to the parent data source and bind the second
  25. column to the whole child data source.
  26. In order to show cascade look up list in the second column, handle its
  27. PreparingCellEditing event to get the hosted editing element, in this case a
  28. ComboBox.
  29. Then rebind the ComboBox so as to show the corresponding child data in the
  30. ComboBox's drop down list.
  31. /////////////////////////////////////////////////////////////////////////////
  32. References:
  33. http://windowsclient.net/wpf/wpf35/wpf-dg-preview-ctrl-investments.aspx
  34. http://windowsclient.net/wpf/wpf35/wpf-video-datagrid-ctp-preview.aspx
  35. http://windowsclient.net/wpf/wpf35/wpf-35sp1-toolkit-datagrid-feature-walkthrough.aspx
  36. /////////////////////////////////////////////////////////////////////////////