Datagridview Calendar Column

G

Guest

I've downloaded some code relative to establishing a column on my
DataGridView which allows me to use the DateTimePicker. So far so good. If I
add a column using
dim col as new CalendarColumn
the grid works great. However...I need to assign an existing column ...
from a database. How do I make datagridview1.columns("NoteDate") my
CalendarColumn?

Any suggestions?

Thanks Arne
 
C

ClayB

Here is one way you can do it.

Dim col As New CalendarColumn()
col.DataPropertyName = "NoteDate"
col.HeaderText = "Headertext"
Dim loc As Integer =
dataGridView1.Columns.IndexOf(dataGridView1.Columns("NoteDate"))
dataGridView1.Columns.RemoveAt(loc)
dataGridView1.Columns.Insert(loc, col)

================
Clay Burch
Syncfusion, Inc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top