Remove individual rows of a grid view only on the client side
I have a drop down list. On changing the index of the dropdownlist , I
populate an asp.net gridview.
I have a requirement where the user should be able to remove individual
rows of the gridview on the screen . At the end of each row, I intend to
have a remove button. On clicking the button the row should disappear .
But this should be only on the screen. There should be no changes done in
the database.
I have my code below right now :
aspx
<table>
<tr>
<td>
<div>
<asp:Label ID="lblClient" runat="server" Text="Client
:" CssClass="label" ForeColor="Black"></asp:Label>
<asp:DropDownList ID="ddlClient" runat="server"
AppendDataBoundItems="true" AutoPostBack="true"
OnSelectedIndexChanged="ddlClient_SelectedIndexChanged">
<asp:ListItem Text="ALL" Value="0"></asp:ListItem>
</asp:DropDownList>
</div>
</td>
</tr>
<tr>
<td>
<asp:GridView ID="gvMainLog" runat="server" Visible="true"
AllowSorting="True" AutoGenerateColumns="False"AllowPaging="true">
<Columns>
<asp:BoundField DataField="Instruction"
HeaderText="Instruction" />
<asp:BoundField DataField="ProviderId" HeaderText="Id" />
</Columns>
</asp:GridView>
<div>
<asp:TextBox ID="txtEditMin"
runat="server"></asp:TextBox>
</div>
</td>
</tr>
</table>
aspx.cs
protected void ddl_SelectedIndexChanged(object sender, EventArgs e)
{
gvMainLog.DataSource = GetSetupUtility(1);
gvMainLog.DataBind();
}
No comments:
Post a Comment