PC Review


Reply
Thread Tools Rate Thread

Datagridview Calendar Column

 
 
=?Utf-8?B?QXJuZSBCZXJ1bGRzZW4=?=
Guest
Posts: n/a
 
      15th Feb 2007
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
 
Reply With Quote
 
 
 
 
ClayB
Guest
Posts: n/a
 
      15th Feb 2007
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.

 
Reply With Quote
 
=?Utf-8?B?QXJuZSBCZXJ1bGRzZW4=?=
Guest
Posts: n/a
 
      15th Feb 2007
That worked great...thanks


"ClayB" wrote:

> 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.
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGridView Column Alfred Roth Microsoft C# .NET 1 23rd Jun 2010 11:33 PM
Calendar Spreadsheet: Column 1 = Date, Column 2 Time of Day, Column 3 memo text field JDJ Microsoft Excel Discussion 0 24th May 2007 01:14 AM
Datagridview Calendar Column DBNull Error =?Utf-8?B?QXJuZSBCZXJ1bGRzZW4=?= Microsoft VB .NET 0 17th Feb 2007 04:08 PM
datagridview, using calendar control selecting a date for column Bob Microsoft VB .NET 2 8th Jun 2006 01:38 PM
DataGridView - refreshing calculated columns when move from column to column. Greg Microsoft C# .NET 1 30th May 2006 07:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:45 AM.