A set of technologies in .NET for building web applications and web services. Miscellaneous topics that do not fit into specific categories.
Hi @david 237 ,
Through your code, I think you want to use jQuery to hide the rows whose Status is Finished and click the button to display all the rows.
You need to override Status with a TemplateField in order to find the Status row.
You can refer to the code below:
jQuery Code:262398-2.txt
<asp:GridView ID="Gridview1" class="mx-auto" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
KeyNames="Id_Task" AllowPaging="True" PageSize="6" CellPadding="6" ForeColor="#333333" GridLines="Vertical">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:BoundField DataField="Id_Task" HeaderText="Id_Task" SortExpression="Id_Task" Visible="false" />
<asp:BoundField DataField="Taches a faire" HeaderText="Taches a faire" SortExpression="Taches a faire" />
<asp:BoundField DataField="Username" HeaderText="Username" SortExpression="Username" />
<asp:BoundField DataField="date de requete" HeaderText="date de requete" SortExpression="date de requete" />
<asp:BoundField DataField="deadline" HeaderText="deadline" SortExpression="deadline" />
<asp:TemplateField HeaderText="Status">
<ItemTemplate>
<asp:Label ID="lblStatus" Text='< % # E val("Status") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField Text="Details" DataNavigateUrlFields="Id_Task,Taches a faire,Username,date de requete" DataNavigateUrlFormatString="~/Admin/NewPage.aspx?Id_Task={0}&Taches a faire={1}&Username={2}&date de requete={3}" />
</Columns>
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
<RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
<SortedAscendingCellStyle BackColor="#FDF5AC" />
<SortedAscendingHeaderStyle BackColor="#4D0000" />
<SortedDescendingCellStyle BackColor="#FCF6C0" />
<SortedDescendingHeaderStyle BackColor="#820000" />
</asp:GridView>
<asp:Button ID="btnHide" Text="Hide Finished " runat="server" />
<asp:Button ID="btnShow" Text="Show All" runat="server" />
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.