FindControl in FormView

  • Thread starter Zarn Bou via DotNetMonster.com
  • Start date
Z

Zarn Bou via DotNetMonster.com

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

FormView FindControl error 1
FormView and FindControl behaviour 4
FindControl in FormView Edit Template 1
FormView 0
FormView - FindControl 14
FormView 3
formview edit issue 12
FormView insert with UpdatePanel 0

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,900
Latest member
Nell636132

Latest Threads

Top