The user then inputs their own information into OAge, OYields, OPlantDate, and OPlantFrom.
The rest of the fields in the footer row are labels that will be populated based on the final OVariety selection.
I only need help with populating one ddl based on the ddl selection of another and how to populate a label based on a ddl selection.
</asp:TemplateField>
<asp:TemplateField HeaderText="OTypeName" SortExpression="OTypeName">
<EditItemTemplate>
<asp:DropDownList ID="DropDownList1"
runat="server"
AutoPostBack="True"
DataSourceID="dsTypeName"
DataTextField="OrchardTypeName"
DataValueField="OrchardTypeID" >
</asp:DropDownList>
<asp:SqlDataSource ID="dsTypeName" runat="server" ConnectionString="<%$ ConnectionStrings:DB_9DE518_PermacultureConnectionString %>" SelectCommand="SELECT * FROM [tblOrchardType]"></asp:SqlDataSource>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("OTypeName") %>'></asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:DropDownList ID="ddlTypeName"
runat="server"
AutoPostBack="True"
DataSourceID="dsTypeName"
DataTextField="OrchardTypeName"
DataValueField="OrchardTypeID"
>
</asp:DropDownList>
<asp:SqlDataSource ID="dsTypeName" runat="server" ConnectionString="<%$ ConnectionStrings:DB_9DE518_PermacultureConnectionString %>" SelectCommand="SELECT * FROM [tblOrchardType]"></asp:SqlDataSource>
</FooterTemplate>
I'm not sure what to put in the aspx.cs file but here's what I have so far concerning the Index Change for the ddl:public void ddlTypeName_SelectedIndexChanged(object sender, EventArgs e)
{
//Enable ddlSpecies
//Populate ddlSpecies based on ddlTypeName selection
var ddlTypeValue = ddlTypeName.SelectedValue;
}
Any help would be much appreciated!