473,698 Members | 2,440 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Display hide controls in a gridview

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 or date

Depending on the question I would like to display or hide the tick box
or text boxes.

I am working on asp.net 2 and Visual Basic.
Thank you very much in advance for your help

Anne

Sep 16 '07 #1
1 1772
Something along the lines of

//item is the gridview item row.

ctype(item.finc ontrol("yourcon trolname"),Your ControlType).vi sible=False

"Anne" <an******@consu ltant.comwrote in message
news:11******** **************@ n39g2000hsh.goo glegroups.com.. .
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 or date

Depending on the question I would like to display or hide the tick box
or text boxes.

I am working on asp.net 2 and Visual Basic.
Thank you very much in advance for your help

Anne

Sep 16 '07 #2

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

Similar topics

1
3878
by: scartin | last post by:
I'm fairly new to working with ASP web controls, and am running into what seems to be a ridiculous problem that I'm hoping will be a breeze for an experienced ASP developer. I have a GridView and a FormView on the same page, where the GridView is visible at page load, and the FormView is set to Edit mode by default, but is hidden on the page. I have the Select link enabled on my GridView, and I use the SelectedIndexChanged event to hide...
7
1752
by: | last post by:
I'm using ASP.NET 2.0, C#, SQL Server 2005, and databound controls like the DataList and the GridView. Right now I'm using SqlDataSource as part of very quick and dirty site; I'm not looking to tier things. I want the topmost/first data element in a particular control to NOT be displayed. This should be possible by either telling the renderer to hide the first element programmatically, or by deleting it from the data store that it has...
3
7724
by: | last post by:
I'm using the DataList and GridView controls, and I am trying to wrap my head around the problem of conditionally showing or hiding cells/cell content based on the presence or absence of DB data. I am finding this sort of problem by far the most annoying part about working with ASP.NET controls. What I want is to know how to do three things: - conditionally show or hide an ImageField +column+ based on whether or not an the...
2
7225
by: =?Utf-8?B?Z2FuZQ==?= | last post by:
Hi, In a gridview, How can i display different columns between item and edit modes. For eg. i have a sql that returns productname, categoryname, etc. In viewmode, i need to display only productname column and not categoryname column. Again in Edit mode, i need display/edit category name only. But not productname column shouldnt be displayed/editable. In visual studio 2005, I tried converting the columns to template fields and
3
6095
by: sheenaa | last post by:
Hello friends, I m using ASP.NET with C# 2005 and SQL SERVER 2005 for the ASP.Net Website. I m using sqldatasource to connect and retrieve the data from database and then it displays the data in the gridview on the button click event.I have created the stored procedure for insert and select query. I Want to display the autoincrement id on the label or textbox control on the form and also on the click event of the button it should...
4
2067
by: seth_hickel | last post by:
With other solutions I would get a recordset, read each record and display data by formating my html as I wanted to display values of each record. I am trying to display data in a three column three row table with paging. How does this translate to ASP.NET - or - what ASP.NET tools do I use to accomplish this and how. Thank you.
0
1363
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 entered record in the database. view click event it should saw me all the details except the id of the company. The data is displayed in the gridview. How should i pass this ?? <asp:GridView ID="CompanyGridView" runat="server"...
4
6021
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
6
4527
by: Steve Harclerode | last post by:
Hi, I'm trying to get my DataGrid to show headers and footers when no rows are returned from the datasource. Below is code that shows the first TemplateField. Is there an easy way to get at least the footer to show? I want to be able to insert a new row using the footer. Thanks... <asp:GridView ID="gvMaterials" runat="server" AutoGenerateColumns="False" DataSourceID="dsMaterials" ShowFooter="True" Width="100%"
0
8676
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8608
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9161
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8897
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7732
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6522
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4370
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.