PageRenderTime 54ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/Visual Studio 2008/VBWinFormDataGridView/CustomDataGridViewColumn/ReadMe.txt

#
Plain Text | 64 lines | 40 code | 24 blank | 0 comment | 0 complexity | b43e23ab44b5f72ed7c71b602a37ff09 MD5 | raw file
  1. ================================================================================
  2. WINDOWS FORMS APPLICATION : VBWinFormDataGridView Project Overview
  3. CustomDataGridViewColumn Sample
  4. ===============================================================================
  5. /////////////////////////////////////////////////////////////////////////////
  6. Use:
  7. This sample demonstrates how to create a custom DataGridView column.
  8. /////////////////////////////////////////////////////////////////////////////
  9. Remark:
  10. There're six standard DataGridViewColumn types for use as follows:
  11. DataGridViewTextBoxColumn
  12. DataGridViewCheckedBoxColumn
  13. DataGridViewComboBoxColumn
  14. DataGridViewLinkColumn
  15. DataGridViewButtonColumn
  16. DataGridViewImageColumn
  17. However, developers may want to use a different control for editing on the column,
  18. e.g. MarkedTextBox, DateTimePicker etc. This feature can be achieved in two ways:
  19. 1. Create a custom DataGridViewColumn;
  20. The code in this CustomDataGridViewColumn sample demonstrates how to do this;
  21. 2. Place the editing control on the current cell when editing begins, and hide
  22. the editing control when the editing completes. For the details of this
  23. approach, please refer to the EditingControlHosting sample.
  24. /////////////////////////////////////////////////////////////////////////////
  25. Creation:
  26. 1. Create a MaskedTextBoxEditingControl class derive from MaskedTextBox class
  27. and IDataGridViewEditingControl class, see the code in the
  28. MaskedTextBoxEditingControl.vb file for the implementation details;
  29. 2. Create a MaskedTextBoxCell class derive from DataGridViewTextBoxCell class,
  30. see the code in the MaskedTextBoxCell.vb file for the implementation details;
  31. 3. Create a MaskedTextBoxColumn class derive from DataGridViewColumn class,
  32. see the code in the MaskedTextBoxColumn.vb file for the implementation details;
  33. 4. Build the program;
  34. /////////////////////////////////////////////////////////////////////////////
  35. References:
  36. 1. DataGridView Custom Column Sample
  37. http://msdn.microsoft.com/en-us/library/ms180996.aspx
  38. 2. Windows Forms FAQs
  39. http://windowsclient.net/blogs/faqs/archive/tags/Custom+Designers/default.aspx
  40. /////////////////////////////////////////////////////////////////////////////