.NET Framework Samples
DataGridView Custom Column Sample

This sample demonstrates how to create a custom DataGridViewColumn type with cells that host a MaskedTextBox control.

For information about using the samples, see the following topics:

Security noteSecurity Note:

This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or consequential damages should the sample code be used for purposes other than as intended.

To build and run the sample using the command prompt

  1. At the command prompt, navigate to the location where you saved the uncompressed sample files.

  2. Navigate to the CS subdirectory under the DataGridViewCustomColumn directory.

  3. Type msbuild to build the sample using the solution (.sln) file provided.

  4. Type cd DataGridViewCustomColumnTest\bin\Debug to navigate to the location of the executable file.

  5. Type DataGridViewCustomColumnTest.exe to run the sample.

To build and run the sample using Visual Studio

  1. In Windows Explorer, navigate to the location where you saved the uncompressed sample files.

  2. Navigate to one of the language-specific subdirectories under the DataGridViewCustomColumn directory.

  3. Double-click the solution (.sln) file to open it in Visual Studio.

  4. In Visual Studio, press F5 to build and run the sample.

To use the DataGridViewCustomColumn Sample

  1. Run the provided test application, which displays a DataGridView control containing several MaskedTextBox columns with different masks.

  2. Try entering different values into the different columns.

Demonstrates

See Also

Reference

Other Resources

Tags :


Community Content

Thomas Lee
Link to sample
Am I being dense or is there no link to the sample?!
Tags : contentbug

Thomas Lee
Missing download link

The link will be restored in the next release of the documentation. You can download the .NET Framework 2.0 version of the sample from the 2.0 version of the page.

Tags : contentbug

Thomas Lee
Where is DataGridViewCustomColumn Sample?
I've downloaded the SDK samples, there is no project for the DataGridViewCustomColumn. Please update this page.
Tags : contentbug

Thomas Lee
August 2009 - still no sample
There is still no sample. I'm surprised the documentation on this matter is so scarce.
Tags : contentbug

G W C
October 2009 - still no sample

There is a sample in the VS 2005 content, but it is missing for VS 2008. Seems like this should be corrected.

Tags : contentbug

Page view tracker