Connecting Tech Pros Worldwide Help | Site Map

gridview custom no. column

  #1  
Old June 23rd, 2009, 08:01 AM
Site Addict
 
Join Date: Feb 2007
Posts: 553
Hi

New to vb.net

I create a GridView. It has default three columsn. cant find the way to delete a colmn, i want only 1 column in it

how to do this from design view?

thanks
qi
  #2  
Old June 23rd, 2009, 04:46 PM
Member
 
Join Date: Jun 2009
Posts: 33

re: gridview custom no. column


sounds like your using visual studio or web developer - are you?
how are you planning to feed the data into the grid (filling a dataset w code vs. creating a connection object)?
  #3  
Old June 26th, 2009, 08:16 PM
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North :)
Posts: 4,940
Provided Answers: 8

re: gridview custom no. column


Your GridView or DataGridView's columns are automatically added for you based on the DataSource that it's bound to.

When you bind the GrdiView or DataGridView to a data source, the data source's properties (if it's an Object) or columns (if it's a table) become the columns displayed for the GridView or DataGridView.

If you don't want certain columns to be displayed you have a couple of options.

The first one would be to modify the data source so that it only contains the columns/properties that you want displayed.

The second would be to modify the GridView or DataGridView itself. But before I can recommend how to do this I need to know, are you using an ASP.NET GridView or are you developing a desktop application and you're using the DataGridView?

-Frinny
Reply

Tags
gridview


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gridview and Setting column width problem Chuck answers 4 August 29th, 2006 05:25 PM
Dynamic template for a delete button in gridview NateDawg answers 3 August 15th, 2006 03:25 PM
Optimistic concurrency in custom GridView/SqlDataSource Mike Kelly answers 8 January 4th, 2006 03:25 PM
Filtering data inside the Gridview Control? answers 7 December 22nd, 2005 01:25 AM