2.0: GridView associated to DropDownList

R

R.A.M.

Hi,
Please help. I have definied a GridView associated to DropDownList but
it's not visible. Here's the code:

<asp:DropDownList ID="Publishers" runat="server"
DataSourceID="PublishersSQL" DataTextField="Name"
DataValueField="Name" AutoPostBack="True" />
<asp:SqlDataSource ID="PublishersSQL" runat="server"
ConnectionString="<%$ ConnectionStrings:SQLServerConnectionString %>"
SelectCommand="SELECT Name FROM Publishers ORDER BY Name">
</asp:SqlDataSource>
<asp:GridView ID="Books" runat="server"
AllowSorting="True" AutoGenerateColumns="False" CellPadding="4"
DataSourceID="BooksSQL" GridLines="None">
<Columns>
<asp:CommandField ShowSelectButton="True" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="BooksSQL" runat="server"
ConnectionString="<%$ ConnectionStrings:SQLServerConnectionString %>"
SelectCommand="SELECT Books.Title, Books.Author, Books.ISBN FROM Books
INNER JOIN Publications ON Books.ISBN = Publications.ISBN WHERE
(Publications.PublisherName = @Publisher) ORDER BY Books.T">
<SelectParameters>
<asp:ControlParameter ControlID="Publishers"
Name="Publisher" PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:SqlDataSource>

Thank you
/RAM/
 

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

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top