Consider a GridView with a checkbox column. We want to select all checkboxes or clear all checkboxes within this column using a Select All checkbox in the header row.

GridView Definition

The GridView has a template column. Template defines the header row as well as the item row. In the header row, we have the Select All checkbox. And within in the item row, we have a checkbox to select an item.…

Read More

ASP.NET UI

There are two Listboxes – list1 and list2. And four buttons. We want to move items from the one Listbox to another.

There is a:

  • Add button to add selected items.
  • Add All button to add all items.
  • Remove button to remove selected items.
  • Remove All button to remove all items.

We are using classic ASP.NET Web forms.

<div>
  <asp:ListBox ID="list1" runat="server">
    <asp:ListItem Text="One"></asp:ListItem>
    <asp:ListItem Text="Two"></asp:ListItem>
    <asp:ListItem Text="Three"></asp:ListItem>
  </asp:ListBox>
  <asp:Button ID="btnAdd" runat="server" Text=">" />
  <asp:Button ID="btnAddAll" runat="server" Text=">>" />
  <asp:Button ID="btnRemove" runat="server" Text="<"/>
  <asp:Button ID="btnRemoveAll" runat="server" Text="<<" />
  <asp:ListBox ID="list2" runat="server"></asp:ListBox>
</div>

jQuery

The jQuery code for moving items is simple enough.…

Read More