<table> <tr> <td align="left"><asp:Label id="lblShow" Text="Select Perway Status : " Font-Bold="true" runat="server"></asp:Label> <asp:DropDownList ID="ddlShow" runat="server" DataSourceID="SqlDataSource3" DataTextField="Perway_Status" DataValueField="Perway_Status" AutoPostBack="true" onselectedindexchanged="ddlShow_SelectedIndexChanged" > <asp:ListItem Text="All" Value="All" Selected="True" Enabled="True" /> </asp:DropDownList> <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:DropDownListConnectionString %>" SelectCommand="SELECT TOP 9 Station_Status_Current.Status_Time, Stations.Station_Name, Stations.Station_Lines, Sections.Section_Name, Sections.Perway_Status, Sections.Equipment_Status FROM Station_Status_Current INNER JOIN Stations ON Station_Status_Current.Station_ID = Stations.Station_ID CROSS JOIN Sections CROSS JOIN Status_Legend"> </asp:SqlDataSource> </td> </tr> </table> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:StatStressConnectionString2 %>" SelectCommand="SELECT TOP 9 Station_Status_Current.Status_Time, Stations.Station_Name, Stations.Station_Lines, Sections.Section_Name, Sections.Perway_Status, Sections.Equipment_Status FROM Station_Status_Current INNER JOIN Stations ON Station_Status_Current.Station_ID = Stations.Station_ID CROSS JOIN Sections CROSS JOIN Status_Legend"> </asp:SqlDataSource> <asp:GridView ID="gvShowAll" runat="server" AutoGenerateColumns="False" HorizontalAlign="Center" CellPadding="5" PageSize="20" AllowPaging="True" DataSourceID="SqlDataSource1"> <Columns> <asp:BoundField DataField="Status_Time" HeaderText="Status Time" SortExpression="Status_Time" /> <asp:BoundField DataField="Section_Name" HeaderText="Section Name" SortExpression="Section_Name" /> <asp:BoundField DataField="Perway_Status" HeaderText="Perway Status" SortExpression="Perway_Status" /> <asp:BoundField DataField="Equipment_Status" HeaderText="Equipment Status" SortExpression="Equipment_Status" /> <asp:BoundField DataField="Station_Name" HeaderText="Station Name" SortExpression="Station_Name" /> <asp:BoundField DataField="Station_Lines" HeaderText="Station Lines" SortExpression="Station_Lines" /> </Columns> </asp:GridView> </asp:Content>
protected void ddlShow_SelectedIndexChanged(object sender, EventArgs e) { SqlDataSource3.DataBind(); gvShowAll.DataBind(); } public override void VerifyRenderingInServerForm(Control control) { return; }
protected void ddlShow_SelectedIndexChanged(object sender, EventArgs e) { gvShowAll.DataSource = SqlDataSource3; gvShowAll.DataBind(); } public override void VerifyRenderingInServerForm(Control control) { return; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)