472,127 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

getting data binding parameters from another WebControl

I have two SqlDataSources that use two different stored procedures that
take parameters to populate two controls, one dependant on an element
of the other.

The first data source, PreBuyDataSource is bound to PreBuyDetailsView
control and its parameters come from the session or request. The
stored procedure will always only find one row, and I found the
DetailsView control to be convenient.

The second data source, BudgetDataSource is bound to BudgetDetailsView
control and one of the parameters is an element in the data present in
the PreBuyDetailsView. Likewise, the stroed procedure will always only
find one row, and I found the DetailsView control to be convenient.

Specifically, the element that BudgetDataSource depends on is


....or in English, the column named PRBCODE (column index 3) that gets
returned from the stored procedure.

When I click on the SelectQuery to bring up the dialog for
BudgetDataSource's stored procedure, I have my parameters, one of which
needs to come from PRBCODE. I set my Parameter Source to "control." I
set my control ID to PreBuyDetailsView. Under the advanced properties,
the property name defaults to SelectedValue, which appears blank to me.
I tried to set it to DataItem.Item("PRBCODE"), but when I do that I
get an error: 'System.Data.DataRowView' does not contain a property
with the name 'Item'.

System.Data.DataRowView DOES contain a public property named Item since
I can access it directly for instance by setting a labels text value to
PreBuyDetailsView.DataItem.Item("PRBCODE"). However, my grasp of when
and where the databinding takes place for multiple controls is
admittedly weak.

I cannot figure out how to get the data binding on my BudgetDetailsView
to use that value from PreBuyDetailsView. I am new to ASP.NET and hope
I am either going about this in entirely the wrong way, or missing some
key bit of insight. Either way, can anyone tell me how I can set that
value as a parameter for my second data source?

Dec 5 '06 #1
0 1294

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by D Witherspoon | last post: by
5 posts views Thread by Vigneshwar Pilli via DotNetMonster.com | last post: by
reply views Thread by NicK chlam via DotNetMonster.com | last post: by
5 posts views Thread by Laura K | last post: by
reply views Thread by Steven Bolard | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.