Wizard control in 2.0 and dynamic items

N

nirbhay

Hello

Please let me know if this is possbile in 2.0
I use Wizard Control to pull certain info from the database and let
users change the same step-by-step.
I have set the # of steps at design time but in each step i populate a
datalist(list of textboxes populated)
It all works fine but when i try to retrieve the values from these
TextBoxes in the onClickFinish handler using wizard.FindControl , it
returns null.

Is there a way i can access the values from the controls that gets
populated dynamically ?
The problem is , i have to get to the database to determine how many
textboxes i need to show in a step.??

I really like the wizard control and am hoping there would be a
workaround for this.
I know it works if i specify the TextBoxes at design time without using
the DataList.

But not always, we have all information that could be set at design
time ... :(

Cheers




Cheers
 
A

Alessandro Zifiglio

hi, since the textboxes are children of your datalist and not direct
children of your wizard control, you have to first find the datalist, then
wireup the necessary methods exposed by the datalist, like the
onItemCreated, onItemDataBound, and onItemCommand methods. These are the
methods you will use to retrieve your textboxes or respond to events raised
by children of your datalist.
eg. The onItemCreated method is raised when the textboxes are created, but
the values are not populated. The onItemDataBound is raised when the
textboxes are populated and the onItemCommand event is raised when a
childcontrol in your datalist raises an event. So you will retrieving the
values in one of these methods exposed since they tell you exactly what
occurred in the datalist(eg. the creation of the controls or those controls
being already bound to the datasource).
It could be that you are already doing this and that i have misunderstood
why you are unable to retrieve the textbox values in question, in this case
try to post some sample with a simple test case =P

have a good weekend,
Alessandro Zifiglio
 
M

Matthew

The only way I managed to do this was to access the objects directly from
the wizard pages.

Like this:

// Get the wizard control
WizardStepBase thisStep = QuizWizard.WizardSteps[WizardPage];

// Get the HTML Table inside the wizard page
HtmlTable thisTable = (HtmlTable)thisStep.Controls[0];

// Get the radiobutton list from the table
RadioButtonList radioButtons =
(RadioButtonList)thisTable.Rows[0].Cells[1].Controls[1];

// Return it
return radioButtons.SelectedValue;

Hope this helps !

Of course you will need to moodify this for the objects in your wizardpage.
 

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

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top