469,889 Members | 1,412 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Nested Information (DataList + GridView) Question

Hello there.

I need a DataList to render the Gridview by providing one of the
DataList values as a query for the underlaying Gridview.

This does not work:

SelectCommand="select * from projects where emp_id = <%# Eval("EMP_ID")
%>"

This is my code (simplified):

<asp:SqlDataSource
ID="SQLDSEmp"
SelectCommand="select * from employees"
...
/>

<ASP:DataList
ID="DataListEmp"
DataSourceID="SQLDSEmp"
>
<ItemTemplate>
<asp:Label ID="titleLabel" Text='<%# Eval("EMP_NAME") %>'/>

<asp:GridView
DataSourceID="OrderDetailsDataSource"
AutoGenerateColumns="False" />

<asp:SqlDataSource
ID="OrderDetailsDataSource"
SelectCommand="select * from projects where
emp_id = <%# Eval("EMP_ID") %>">
</asp:SqlDataSource>
</ItemTemplate>
</ASP:DataList>

Sep 3 '06 #1
0 1159

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Phil | last post: by
1 post views Thread by TheHach | last post: by
1 post views Thread by ultraweaver | last post: by
1 post views Thread by H5N1 | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.