DataGridView Column Type Property

Imad Almuzain 21 Reputation points
2021-04-14T14:46:59.523+00:00

Hello
On following document show how to define the DataGridView Column Type, and define calendar column,

https://learn.microsoft.com/en-us/dotnet/desktop/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells?view=netframeworkdesktop-4.8&redirectedfrom=MSDN#compiling-the-code

Could please help, after that how to show the "CalendarColumn" type to appear in the Column types list of DataGridview column types to choose it where required, as shown on following photo

87796-dd.jpg

Developer technologies | VB
Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other
A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
{count} votes

Answer accepted by question author
  1. Karen Payne MVP 35,596 Reputation points Volunteer Moderator
    2021-04-14T15:10:37.877+00:00

    I have a code sample for this in C# but not VB .NET.

    See Windows forms DataGridView dates and numeric columns (C#) article and source code for using in C#.

    Here is a starter project on GitHub.
    87790-f1.png

    87861-c1.png

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Imad Almuzain 21 Reputation points
    2021-04-14T17:41:09.483+00:00

    many thanks karenpayneoregon for reply,

    one question only, when I have the CalendarColumn Class added to project,
    what else should do to let Calendar Column type appear in the list,?

    thanks


  2. Karen Payne MVP 35,596 Reputation points Volunteer Moderator
    2021-04-14T19:04:18.12+00:00

    Here is a full code sample, took about 10 minutes to write. To run requires a SQL-Server database (I don't have another database e.g. MS-Access, Oracle, MySql ready)

    • In the repository run this data script in SSMS (SQL-Server Management Studio)
    • Build
    • Run
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.