PageRenderTime 12ms CodeModel.GetById 7ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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

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