|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Wizard control in 2.0 and dynamic itemsPlease 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 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 Show quoteHide quote "nirbhay" <rms10***@yahoo.com> ha scritto nel messaggio news:1151710385.918855.268860@m73g2000cwd.googlegroups.com... > 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 > 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. Show quoteHide quote "Alessandro Zifiglio" <AlessandroZifiglio @ -h-o-t-m-a-i-l-c-o-m> wrote in message news:uDqMj9RnGHA.1584@TK2MSFTNGP02.phx.gbl... > 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" <rms10***@yahoo.com> ha scritto nel messaggio > news:1151710385.918855.268860@m73g2000cwd.googlegroups.com... >> 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 >> > >
web controls install
SQLDataSource Values is this possible? CheckBoxList Control column width Best way to save properties (ie. text) on webcontrols for reloading (asp.net 2.0) Listbox box validator Newbie: How to add Input with in Table Cell Adding user controls to a panel Treeview Width. any way to know where the focus is in a detailsview? |
|||||||||||||||||||||||