Home All Groups Group Topic Archive Search About

How to convert an existing bound column to use a datetime picker

Author
17 Jun 2006 3:00 PM
Bob
I saw the example at http://msdn2.microsoft.com/en-us/library/7tas5c80.aspx
However that deals with a simple unbound column that's created on the fly.

I have an existing datagrid view column - named colDateActivation to which
in which I need to embed the use of a date time picker.

the code sinppet that does that in the sample is in the sample's form1 form
load event is

Dim col As New CalendarColumn()
        Me.dataGridView1.Columns.Add(col)

I guess in my case I would need to replace the
Me.dataGridView1.Columns.Add(col) with something else but I can't get my
finger on it.

Any help would be appreciated, I've been at this for a few dauys now and I
really would like to move forward.

Bob

Author
18 Jun 2006 5:30 PM
Ken Tucker [MVP]
Bob,

        You need to remove the colDateActivation and add it back to the
datagridview as a datetime column.  There is an example on how to change a
column to a combobox column on the vb-tips website

http://www.vb-tips.com/default.aspx?ID=492bcbbc-f881-45c8-9b3a-62c7a184f472

Ken
------------------------------

Show quoteHide quote
"Bob" wrote:

> I saw the example at http://msdn2.microsoft.com/en-us/library/7tas5c80.aspx
> However that deals with a simple unbound column that's created on the fly.
>
> I have an existing datagrid view column - named colDateActivation to which
> in which I need to embed the use of a date time picker.
>
> the code sinppet that does that in the sample is in the sample's form1 form
> load event is
>
> Dim col As New CalendarColumn()
>         Me.dataGridView1.Columns.Add(col)
>
> I guess in my case I would need to replace the
> Me.dataGridView1.Columns.Add(col) with something else but I can't get my
> finger on it.
>
> Any help would be appreciated, I've been at this for a few dauys now and I
> really would like to move forward.
>
> Bob
>
>
>
>