Click here to Skip to main content
15,894,539 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
< my Question - how can we add date time picker in grid view column , in window application using vb.net .>
grid view column contain date time picker with current date n time
plz reply...
Posted
Comments
TryAndSucceed 16-Jan-14 10:33am    
Ajax Calendar Extender is an option.
Member 10067861 17-Jan-14 2:19am    
Not Getting , plz dont mind .
where i written this below code
Public Class Form1
Inherits Form

Private dataGridView1 As New DataGridView()

<stathreadattribute()> _
Public Shared Sub Main()
Application.Run(New Form1())
End Sub

Public Sub New()
Me.dataGridView1.Dock = DockStyle.Fill
Me.Controls.Add(Me.dataGridView1)
Me.Text = "DataGridView calendar column demo"
End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) _
Handles Me.Load

Dim col As New CalendarColumn()
Me.dataGridView1.Columns.Add(col)
Me.dataGridView1.RowCount = 5
Dim row As DataGridViewRow
For Each row In Me.dataGridView1.Rows
row.Cells(0).Value = DateTime.Now
Next row

End Sub

End Class

in Component CalendarColumn.vb or in form1 code
name space is also confict is there ...
and one issue in MyBase.CellTemplate = value, -> " CellTemplate is not a member of ' System.ComponentModel.component'"

plz reply...
Member 10067861 17-Jan-14 2:21am    
not getting , plz reply

1 solution

it is quite simple,
right click your project add new component file name it "CalendarColumn"
open code view and paste code in CalendarColumn.cs file from below link,
http://msdn.microsoft.com/library/7tas5c80%28l=en-us,v=vs.80%29.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1[^]
Now build your project
after successful build you will able to see this type of column in your datagridview while adding new column or editing type of existing column
Happy Coding!
:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900