473,563 Members | 2,797 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to hide a GridView column?

What is the best way to hide a GridView column?

Thanks,

Keith
Oct 26 '06 #1
1 1445
Keith,

If you need the hidden column value to be available either on client side or
after postbacks, hide it with a css rule display:none. Otherwise just set
Visible=false. The reason for this difference is that server controls with
Visible=false don't get rendered to the client and don't come back on
postbacks.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Keithb" <no*****@dslext reme.comwrote in message
news:Ov******** ********@TK2MSF TNGP02.phx.gbl. ..
What is the best way to hide a GridView column?

Thanks,

Keith

Oct 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
7175
by: Jason | last post by:
How do I hide a column in a GridView in ASP.NET 2.0 when all of the columns are autogenerated based on the datasource? I want to hide the first of three columns, but the following doesn't work: DataTable dt = new DataTable(); DataColumn dc; dc = new DataColumn(); dc.ColumnName = "blog_entry_id"; dc.DataType =...
2
7244
by: shekar | last post by:
Hi, I am showing data in gridview... But i want to hide one particular column in that gridview but i must not keep that column property visable=false....if i keep false i am getting problem when i am updating the row...becoz that is datakeynames.. any suggesstions plz.... Shekar.
1
2713
by: Sean | last post by:
I have my gridview bound to a objectdatasource control and the only thing I need to hide on the grid is the primary key but I need the key in the dataset that refers to it. With a dynamic approach the column can be hidden at a certian point in the rendering cycle. As I have learned today my grid never offically has a column(0) and I would...
9
8670
by: ghostwolf | last post by:
Hi, I want to hide a column in the asp:GridView, say one of the column of asp:BoundField. But it is not allowed to put <divinside for setting it display:none. What can I do? Thanks in millions.
2
18878
by: Keithb | last post by:
I need to hide a GridView's "edit" column if the user's role does not support editing. However, the column's Visible property does not support databinding. Is there a workaround? Thanks, Keith
3
7489
by: =?Utf-8?B?Um9iZXJ0IENoYXBtYW4=?= | last post by:
Hi, I have a GridView with a fixed number of columns being returned from a SQL query and each having a simple template: <asp:TemplateField HeaderText="Allocations"> <edititemtemplate> <asp:TextBox id="txt89" runat="server" Text='<%# Bind("89") %>' asp:TextBox> </edititemtemplate> </asp:TemplateField>
4
6009
by: Luqman | last post by:
I have populated the Child Accounts and Parent Accounts in a Grid View Control, I want to hide the Select Column of Parent Accounts, but not the Child Accounts, is it possible ? I am using VS 2005 ? Best Regards, Luqman
1
1765
by: Anne | last post by:
Hi, I have a gridview that display questions & answers. In some case the answers are text (up to 5000 char) and other cases they are tick boxes or numbers ($), or date. I have created 2 columns: Column 1: Displays a label with the question and under it a textbox with the answer Column 2: Displays the tick box, or textbox with the number...
0
1035
by: =?ISO-8859-1?Q?=22Fernando_A=2E_G=F3mez_F=2E=22?= | last post by:
Hello all, I have an ASP.NET page with a GridView bounded to a DataSource. When I click the edit button/link, I'm able to update the data with no problemos. However, if further in my code I hide a column, i.e.: _gridView.Columns.Visible = false; then when I try to save the changes made to and edited record, it won't do anything. This...
0
7665
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7888
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7642
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6255
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1200
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.