473,396 Members | 1,865 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.

FindControl in FormView

Hi,
I am creating a site that uses a master/detail type structure, where I
am using the Gridview to display the master records, and when the user
selects one of these I display all the details for this record in a
FormView detail section.
Now I want to be able to enable and disable certain controls in the
FormView, e.g. a textbox depending on some of the properties for that
record.
I capture the selectedindexchange event for the gridview, and it's at this
time when I want to enable or disable the textbox. I use the
FormView.FindControl() method to try and instantiate the textbox that is in
the EditItemTemplate of the Formview, but it comes up as null.

The only time when I can instantiate the object is if I place a button in
the EditItemTemplate and capture the click event of the button, then I can
instantiate the textbox.
Is there a way to instantiate an object inside a Formview template without
having to be inside the template already?

--
Message posted via http://www.dotnetmonster.com
Nov 19 '05 #1
0 1314

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

Similar topics

3
by: Martin | last post by:
Hi, I have a very frustrating problem that I have researched for countless hours to no avail. There are many posts asking very similar things, however none usefull in my situation. I am using VS...
6
by: Paul Aspinall | last post by:
Hi I'm having trouble trying to use FindControl with a FormView, but can't seem to find what I'm doing wrong.... I have a TextBox in my ItemTemplate, and I want to assign a value to it, in...
2
by: sck10 | last post by:
Hello, I am trying to get the value of a control in a FormView. In vb, I would use the following: e.NewValues("ServiceIdeaQ01") =...
6
by: MRW | last post by:
Hello! I have a problem, I can't seem to solve. I'm making a class in my page that will hold the members of a FormView, so I can access them freely throughout the several functions and...
0
by: jobs | last post by:
In the below code, why can't I equate which form to a formview like we do with controls under the main control. The below gives me an error because whichform does not really take all the properties...
2
by: Mr. SweatyFinger | last post by:
why why why why why why why why why why why Can't i get dim PlaceHolderPrice as placeholder = formview1.findcontrol("PlaceHolderPrice") <asp:FormView ID="FormView1" runat="server"...
1
by: SteveT | last post by:
Before I pull out what little hair I have left, I'm swallowing my pride and asking the Oracles of .Net: I'm trying to set a property in a dropdown list control in a FormView, based on a session...
12
by: rsdev | last post by:
Hi, I am using FindControl to access dynamically loaded user controls. I'm sure I've got it all wrong as I'm new to .NET. Currently if I want to access a button or view mode in a user control...
3
by: J055 | last post by:
Hi I can't figure out what the difference is here. Sometimes I have a simple FormView control in a page and I can use the FormView.FindControl method to get a Label or TextBox with in it during...
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
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
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
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.