add new column in gridview using vb.net
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
:)
Re: add new column in gridview using vb.net
You would have to add a control that inherits DataControlField.
References:
http://www.google.com/#q=vb.net+add+column+to+gridview
One important note that is usually overlooked. You must add the new column before databinding, otherwise it will not be included.
Re: add new column in gridview using vb.net