Is a 3 nested dropdpwnlist achievable?

R

rote

I have a 3 dropdownlist and a gridview to display..
What i want is if i load the page i want all the dropdownlist and the
Gridview to get populated and linked on the fly.

But my problem now is when i load the page i want all the dropdownlist
should be populated and linked automatically.
but it doesn't .The first 2 works the last dropdownlist is empty and the
gridview shows nothing..
Any ideas what 'm doing wrong?

All the 3 dropdownlist are linked like so below
<table>

<p>

<tr>

<td>

Select a Dealer

</td>

<td>

<asp:DropDownList ID="ddlDealer" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource4"

DataTextField="dealer" DataValueField="dealer">

</asp:DropDownList>

<asp:Label ID="Label1" runat="server"></asp:Label>

<asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$
ConnectionStrings:cn %>"

SelectCommand="spGetDealer"
SelectCommandType="StoredProcedure"></asp:SqlDataSource>

</td>

</tr>



<tr>

<td>

Select a Master Code

</td>

<td>

<asp:DropDownList ID="ddlMaster" runat="server"
DataSourceID="SqlDataSource1" DataTextField="Master_Code"

DataValueField="mc_id"
OnSelectedIndexChanged="ddlMaster_SelectedIndexChanged"

AutoPostBack="true">

</asp:DropDownList>


<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$
ConnectionStrings:cn %>"

SelectCommand="[spGetAllScheduleMaster]"
SelectCommandType="StoredProcedure">

<SelectParameters>

<asp:ControlParameter ControlID="ddlDealer" Name="dealer"
PropertyName="SelectedValue"

Type="string" />

</SelectParameters>

</asp:SqlDataSource>

</td>

</tr>


<tr>

<td>

Select a Plan Value

</td>

<td>

<asp:DropDownList ID="ddlPlans" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource2"

DataTextField="Plan Code" DataValueField="plan_id"
OnDataBound="ddlPlans_DataBound">

</asp:DropDownList>


<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$
ConnectionStrings:cn %>"

SelectCommand="spGetPlanValuesByID" SelectCommandType="StoredProcedure">

<SelectParameters>

<asp:ControlParameter ControlID="ddlMaster" Name="mc_id"
PropertyName="SelectedValue"

Type="Int32" />

</SelectParameters>

</asp:SqlDataSource>

</td>

</tr>

</table>
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top