467,146 Members | 1,124 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,146 developers. It's quick & easy.

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

PreBuyDetailsView.DataItem.Item("PRBCODE")

....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
  • viewed: 1158
Share:

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
By using this site, you agree to our Privacy Policy and Terms of Use.