GridView inside Wizard - datasource problem

M

Manuel Ricca

Hello all,

I have a Wizard control with a GridView inside it. The GridView is
bound to a SQLDataSource and I set the SelectParameter on the
SQLDataSource's Page_Load event.
In fact, when the main page loads it retrieves an ID from QueryString
and sets a ViewState custom field with it. Then, in SQLDataSource
Page_Load(), the value is retrieved from ViewState and passed as a
SelectParameter.

In the main page Page_Load I have the usual code:
if(!Page.IsPostBack)
{
populateWizard(); // fill some unbound text boxes and stuff
Page.DataBind();
}


Everything works great if the GridView is in the first WizardStep. If
it is on another WizardStep then it won't get loaded correctly,
although I can see, by setting a few breakpoints, that the Page_Load
of SQLDataSource is called and that my custom field in ViewState has
the correct value.

Needless to say, if I try to call GridView.DataBind() I get all the
usual postback error messages (which I still didn't figure out why
they happen anyway).

Can anyone help me? I don't know what to do anymore.

Best Regards,

Manuel
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top