hi all.. do anyone know how to add a new column in gridview using vb.net syntax?

the column that i want to add is not bind to any database unlike the other column in the same gridview.


i try to use
GridView1.Columns.Add("Percentage")
but it turn out to be error.
the error said " Value of type 'String' cannot be converted to 'System.Web.UI.WebControls.DataControlField'"

i'm still new in vb.net and hope that all of you can help me :)

thanks in advance

hi,
is your gridview1 a "datagridview" or "listview" ?

cause there are differences between them.

i'm using datagridview.

As you want to add use column to the gridview

GridView1.Columns.Add("Col1", "ABC") //here col1 is the column name & "ABC" is the header text to disply in the gridview

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.