Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
| Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 20th, 2009, 10:00 AM
Authorized User
 
Join Date: Apr 2006
Location: london, , United Kingdom.
Posts: 19
Thanks: 3
Thanked 0 Times in 0 Posts
Send a message via MSN to akshay144
Default Remove Gridview Column at Runtime

Hi All

I am building a grid at runtime and need to store the primary key values then want to hide this column from the user....

I have tried Gridview.Column.RemoveAt(3) but to no avail...

Does anyone have any ideas?

Kind Regards,
Akshay
  #2 (permalink)  
Old August 21st, 2009, 12:42 AM
Authorized User
Points: 198, Level: 3
Points: 198, Level: 3 Points: 198, Level: 3 Points: 198, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2008
Location: singapore, singapore, Singapore.
Posts: 54
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Quote:
Originally Posted by akshay144 View Post
Hi All

I am building a grid at runtime and need to store the primary key values then want to hide this column from the user....

I have tried Gridview.Column.RemoveAt(3) but to no avail...

Does anyone have any ideas?

Kind Regards,
Akshay
Please make it invisible. dont remove it. if you are removing you will not be able to fetch the values from the column
Gridview.Column[0].visible=false
__________________
Pon Saravanan
VbKnowledgebase.com
  #3 (permalink)  
Old August 26th, 2009, 04:24 PM
Registered User
 
Join Date: Aug 2006
Location: Cairo, Egypt.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to avrail
Default

will visible = false will do your work
but you need to remove the column from the grid
you can remove the column from your dataset
Gridview.Column.RemoveAt(3)
it will work but did you refresh your grid
GridView.Databind();

Last edited by avrail; August 26th, 2009 at 04:29 PM..


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get GridView Cell Value Based on GridView Column stublair C# 2008 aka C# 3.0 0 September 4th, 2008 08:30 AM
binding GridView at runtime! veda Visual Studio 2005 3 August 4th, 2008 06:44 AM
How to print from a dynamic gridview at runtime. VictorVictor ASP.NET 2.0 Professional 0 April 2nd, 2007 02:19 PM
Runtime Column monika.vasvani ASP.NET 1.0 and 1.1 Professional 2 October 25th, 2006 08:53 AM
Remove JTable row and column in one event rpalanivelu J2EE 0 October 30th, 2003 08:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.