I'm trying to set up the GridView to filter the Credentials that belong to a specific Employee. The dropdownlist provides the list of employees, once selected I want the gridview to only populate entries that belong to the specific employee.
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<asp:DropDownList ID="DropDownListEmployee" runat="server"
AutoPostBack="True"
OnSelectedIndexChanged="SelectionHasChanged"
DataSourceID="SqlDataSource2" DataTextField="Fullname"
DataValueField="Employee_ID" AppendDataBoundItems="true"
Width="214px">
<asp:ListItem>Select</asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:DBConnectionString %>"
SelectCommand="SELECT Employee.F_Name + ' ' + Employee.L_Name AS Fullname, Employee.Primary_Address, Employee.Primary_Phone, Employee.E_mail, Credentials.Degree, Credentials.Years_Experience, Credentials.Certifications, Credentials.Positions, Employee.Employee_ID FROM Employee INNER JOIN Credentials ON Employee.Employee_ID = Credentials.Employee_ID"></asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource2" DataKeyNames="Employee_ID">
<Columns>
<asp:BoundField DataField="Fullname" HeaderText="Fullname"
ReadOnly="True" SortExpression="Fullname" />
<asp:BoundField DataField="Primary_Address" HeaderText="Primary_Address"
SortExpression="Primary_Address" />
<asp:BoundField DataField="Primary_Phone" HeaderText="Primary_Phone"
SortExpression="Primary_Phone" />
<asp:BoundField DataField="E_mail" HeaderText="E_mail"
SortExpression="E_mail" />
<asp:BoundField DataField="Degree" HeaderText="Degree"
SortExpression="Degree" />
<asp:BoundField DataField="Years_Experience" HeaderText="Years_Experience"
SortExpression="Years_Experience" />
<asp:BoundField DataField="Certifications" HeaderText="Certifications"
SortExpression="Certifications" />
<asp:BoundField DataField="Positions" HeaderText="Positions"
SortExpression="Positions" />
<asp:BoundField DataField="Employee_ID" HeaderText="Employee_ID"
InsertVisible="False" ReadOnly="True"
SortExpression="Employee_ID" />
</Columns>
</asp:GridView>
</asp:Content>