FormView, Pager and SelectedValue issue

Joined
May 29, 2008
Messages
1
Reaction score
0
Good day,

I have a FormView which contains a user control. The FormView is linked to an ObjectDataSource and the user control uses Eval and Bind to display the data - no problems there. The FormView is updated fine.

<asp:FormView ID="frmvFirst"
runat="server"
DataSourceID="odsFirst"
AllowPaging="True"
DataKeyNames="ID"
OnPageIndexChanged="frmvFirst_PageIndexChanged" >

I also have a second FormView that contains a second user control bound to a second ObjectDataSource. This second ObjectDataSource is configured with a ControlParameter which gets the DataKey from the first. More or less a Master-Detail with two FormViews.

<asp:ControlParameter ControlID="frmvFirst"
ConvertEmptyStringToNull="false"
Name="FirstFormIDToBePassedToTheSecondODS"
PropertyName="SelectedValue"
Type="Object" />

My issue starts when I click a pager control on the first FormView. I expected to see the second ODS get the new value from the First ODS and re-select for the second ODS using the SelectedValue (ID). What appears to be happening is the SelectedValue is not changed until after the page is completely loaded. If I click a button causing a post back AFTER the page is fully displayed, the second ODS is properly selected.

I've checked the SelectedValue property in all the events I could plug in there and it remains unchanged from the initial value until the manual postback.

Any tips or workarounds would be appreciated.

Thank you,
Mike Q
 

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,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top