Click here to Skip to main content
15,917,568 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHelp me to get this simple thing Pin
dilhappy5-Jun-07 20:52
dilhappy5-Jun-07 20:52 
AnswerRe: Help me to get this simple thing Pin
Christian Graus5-Jun-07 21:00
protectorChristian Graus5-Jun-07 21:00 
GeneralRe: Help me to get this simple thing Pin
Dave Kreskowiak6-Jun-07 3:32
mveDave Kreskowiak6-Jun-07 3:32 
QuestionAn unhandled exception of type 'System.Data.SQlClient.SQlException' Pin
Vimalsoft(Pty) Ltd5-Jun-07 20:34
professionalVimalsoft(Pty) Ltd5-Jun-07 20:34 
AnswerRe: An unhandled exception of type 'System.Data.SQlClient.SQlException' Pin
SimulationofSai5-Jun-07 21:10
SimulationofSai5-Jun-07 21:10 
QuestionAdd DataGridViewDateTimePickerColumn Pin
kalikarr5-Jun-07 18:01
kalikarr5-Jun-07 18:01 
AnswerRe: Add DataGridViewDateTimePickerColumn Pin
Rupesh Kumar Swami5-Jun-07 21:24
Rupesh Kumar Swami5-Jun-07 21:24 
AnswerRe: Add DataGridViewDateTimePickerColumn Pin
Dave Kreskowiak6-Jun-07 3:29
mveDave Kreskowiak6-Jun-07 3:29 
Basically, you'd be creating your own Column class for the DataGridView. This is NOT for the faint of heart and it would take an entire article to explain it all. But, you need to create 3 classes.

The first, is the Column class for the DataGridView, which will inherit from DataGridViewColumn.
Public Class MyDatePickerColumn
    Inherits DataGridViewColumn


The second is a class that will show the cell contents in the datagridview. You really don't want to show an entire calendar month graphic in there, it simply takes up too much screen realestate to show a date. So, you create a class that your column will use to show the data in a presentable form. This class will use the DataGridViewTextBoxCell as a base to build on.
Public Class MyDateCell
    Inherits DataGridViewTextBoxCell


The final class is the hard one, the edit control. This one has to handle putting up the datetime picker control and letting the user pick a date. Since this class is expected to supply certain methods that your column control will call, it has to implement a specific interface, call IDataGridViewEditingControl. Since your just going to show a datetime picker control, it's be a good place to start with the class.
Public Class MyDateColumnEditControl
    Inherits DateTimePicker
    Implements IDataGridViewEditingControl

Want an example? Here it is[^].


A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


QuestionNeed Help.......Great one Pin
Ayo Lademo5-Jun-07 16:25
Ayo Lademo5-Jun-07 16:25 
AnswerRe: Need Help.......Great one Pin
Paul Conrad5-Jun-07 16:48
professionalPaul Conrad5-Jun-07 16:48 
GeneralRe: Need Help.......Great one Pin
Ayo Lademo6-Jun-07 20:26
Ayo Lademo6-Jun-07 20:26 
GeneralRe: Need Help.......Great one Pin
Paul Conrad7-Jun-07 3:50
professionalPaul Conrad7-Jun-07 3:50 
GeneralRe: Need Help.......Great one Pin
Ayo Lademo7-Jun-07 20:03
Ayo Lademo7-Jun-07 20:03 
AnswerRe: Need Help.......Great one Pin
leckey5-Jun-07 17:23
leckey5-Jun-07 17:23 
AnswerRe: Need Help.......Great one Pin
Christian Graus5-Jun-07 20:23
protectorChristian Graus5-Jun-07 20:23 
AnswerRe: Need Help.......Great one Pin
koolprasad20035-Jun-07 20:36
professionalkoolprasad20035-Jun-07 20:36 
GeneralRe: Need Help.......Great one Pin
Ayo Lademo6-Jun-07 20:36
Ayo Lademo6-Jun-07 20:36 
AnswerRe: Need Help.......Great one Pin
SimulationofSai5-Jun-07 21:02
SimulationofSai5-Jun-07 21:02 
AnswerRe: Need Help.......Great one Pin
Dave Kreskowiak6-Jun-07 3:12
mveDave Kreskowiak6-Jun-07 3:12 
AnswerRe: Need Help.......Great one Pin
Sathesh Sakthivel6-Jun-07 3:25
Sathesh Sakthivel6-Jun-07 3:25 
Questiondatepicker 101 Pin
Visual Very Basic5-Jun-07 15:03
Visual Very Basic5-Jun-07 15:03 
AnswerRe: datepicker 101 Pin
Christian Graus5-Jun-07 15:18
protectorChristian Graus5-Jun-07 15:18 
Question.NET 2.0 BackgroundWorker Pin
Polymorpher5-Jun-07 14:51
Polymorpher5-Jun-07 14:51 
AnswerRe: .NET 2.0 BackgroundWorker Pin
Dave Kreskowiak6-Jun-07 3:17
mveDave Kreskowiak6-Jun-07 3:17 
GeneralRe: .NET 2.0 BackgroundWorker Pin
Polymorpher6-Jun-07 7:55
Polymorpher6-Jun-07 7:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.