VB.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 307,219 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,628 people online right now. Registration is fast and FREE... Join Now!




DataGridView change column type programatically

 

DataGridView change column type programatically

foxbymariuss

1 Jul, 2009 - 11:48 PM
Post #1

New D.I.C Head
*

Joined: 14 May, 2009
Posts: 14

Hello,

I have the following problem regarding DataGridView. I am kinda newbie to VB, so I apologize if the question is a stupid one.

So:
I am using VB 2008.
I have a DataGridView that I use for the output of a SQL select statement. The application composes the SQL select statement, runs it against the database, puts the result in a dataadapter that fills a datatable. The datatable is then set as Datasource for the Datagridview. The DGV column headers are the aliases from the SQL select statement.
The select Statement returns a column that is of datatype Date. The user needs to edit that column. It's much easier to do this via a calendar control (or date - time picker). So using the example found at http://msdn.microsoft.com/en-us/7tas5c80.aspx
I managed to create a column of type date that can be edited by selecting a date from a calendar control.
What I need and don't know how to do is how to set a certain column (that is of date datatype) to be of a certain type (date picker combo box) after binding the datatable to the DGV(after setting the datasource for DGV as being the datatable).
Can anyone please help me with this?

Thank you for any suggestions.

User is offlineProfile CardPM
+Quote Post



Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 10:23PM

Live VB.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month