473,396 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to hide a column in Gridview by request of button click

1
I have been trying for ever to hide a column in gridview using the following code,

GridView1.Columns[6].Visible = false;

but the debugger says that index is out of range, the number columns when runnung Columns.Count is zero

even though I have a table with data it says that there are no columns
Sep 15 '10 #1
1 3733
veenna
65
You should bind the grid view first, before making the column invisible.

regards,
veena
Sep 17 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: hazz | last post by:
oh it hurts to be a newbie again....:-( I have a button click event I want to handle for a button to create an excel spreadsheet from gridview contents. I can't write the code for the button...
0
by: Riaaaa | last post by:
I have created the form for entering the company details with its general information in asp.net C# 2005. I have two buttons that form on the submit click event it should saw the newly / last...
2
by: beish1 | last post by:
Hi I have a page which displays a Gridview containing on each row a checkbox and 3 fields/cells (title, longitude, latitude). On the same page I have two textboxes containing the latitude and...
1
by: jobs | last post by:
I've been staring at this and can't explain why it's not working. The grid shows up fine, except the last column, Reset User button does not render??? I checked the codebehind and I am not...
2
by: Hrvoje Vrbanc | last post by:
Hello all! As I have only recently started to use native ASP.NET 2.0 data access controls (and found them to be very powerful), I have one question that I was unable to find the answer to: -...
4
by: mohaaron | last post by:
This seems like it should be simple to do but for some reason I have been unable to make it work. I would like to databind a SqlDataSource to a GridView during the click event of a button. This...
0
by: hetalupadhyay | last post by:
hi i take one update panel nd put inside gridview when i click print button no operation perform and when i remove update panel then it work perfectly so wht i do?.................to solve this ...
0
by: ADN | last post by:
Hi, I am currently extending the GridView control and would like to add a button to the GridView so that it will automatically render one button at the top of the grid. I have a click event for...
1
by: ravitunk | last post by:
Hello, I have a GridView with the following columns. <asp:GridView ID="myGridView" runat="server" AutoGenerateColumns="False"/> <Columns> <asp:BoundField DataField="name" HeaderText="Name"...
0
by: chamarajanaka | last post by:
I want to show the following data on a Gridview. Request ID Email Date User Type Status Status can be Active or Inactive according to the database value.if its Inactive user must be able to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.