Wizard control in 2.0 and dynamic items

Discussion in 'ASP .Net Web Controls' started by nirbhay, Jul 1, 2006.

  1. nirbhay

    nirbhay Guest

    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
     
    nirbhay, Jul 1, 2006
    #1
    1. Advertising

  2. 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
    "nirbhay" <> ha scritto nel messaggio
    news:...
    > 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
    >
     
    Alessandro Zifiglio, Jul 1, 2006
    #2
    1. Advertising

  3. nirbhay

    Matthew Guest

    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.

    "Alessandro Zifiglio" <AlessandroZifiglio @ -h-o-t-m-a-i-l-c-o-m> wrote in
    message news:...
    > 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
    > "nirbhay" <> ha scritto nel messaggio
    > news:...
    >> 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
    >>

    >
    >
     
    Matthew, Jul 23, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. chetan mistry

    Wizard control and dynamic steps

    chetan mistry, May 15, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    2,083
    chetan mistry
    May 15, 2006
  2. Replies:
    0
    Views:
    634
  3. =?Utf-8?B?U3RldmUgRnVuaw==?=

    Dynamic Wizard with Dynamic Validation Controls

    =?Utf-8?B?U3RldmUgRnVuaw==?=, Oct 13, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    463
    =?Utf-8?B?U3RldmUgRnVuaw==?=
    Oct 13, 2006
  4. Microsoft Newsserver

    ASP.NET Menu Items - Dynamic Items Disapearing

    Microsoft Newsserver, Feb 22, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    407
    bruce barker
    Feb 22, 2008
  5. Andy B
    Replies:
    0
    Views:
    459
    Andy B
    Apr 19, 2008
Loading...

Share This Page