add columns in a datagridview ?

ethicalhacker

Well-known member
Joined
Apr 22, 2007
Messages
142
Location
Delhi,India
Programming Experience
5-10
VB.NET:
Case "flight_details"
                Form3.DataGridView1.Columns.Add("FlightdetailsDataGridViewTextBoxColumn")
doesnt work and
VB.NET:
Case "flight_details"
                Form3.DataGridView1.Columns.Remove("FlightdetailsDataGridViewTextBoxColumn")
works how is that?
what do i have to do to add a column to datagridview
I get an error in the latter code
Value of type 'String' cannot be converted to 'System.Windows.Forms.DataGridViewColumn'.
 
When you write the "(" character after ..Columns.Add the intellisense presents you with two choices because the Add method has two overloads. Take some time to explore the intellisense box that is presented to you here. Read what it says and navigate it. You will see that one of the overloads takes a parameter of type DataGridViewColumn and the other takes two String type parameters (column name and header text). Now try to do what I have explained yourself. As you write more code you will see that the intellisense give you loads of information all the time and helps you complete almost any word you start to write.
 
Back
Top