|
-
September 23rd, 2010, 02:05 AM
#1
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
-
September 27th, 2010, 08:21 AM
#2
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.
Good Luck,
Craig - CRG IT Solutions - Microsoft Gold Partner
-My posts after 08/2015 = .NET 4.x and Visual Studio 2015
-My posts after 11/2011 = .NET 4.x and Visual Studio 2012
-My posts after 02/2010 = .NET 4.0 and Visual Studio 2010
-My posts after 12/2007 = .NET 3.5 and Visual Studio 2008
-My posts after 04/2007 = .NET 3.0 and Visual Studio 2005
-My posts before 04/2007 = .NET 1.1/2.0
*I do not follow all threads, so if you have a secondary question, message me.
-
September 27th, 2010, 09:47 PM
#3
Re: add new column in gridview using vb.net
thank you craig
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|