Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #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.
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 07:52 AM



All times are GMT -4. The time now is 04:36 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.