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?
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?