private void gridElem_OnAction(string actionName, object actionArgument) { switch (actionName.ToLowerCSafe()) { case "delete": int userId = ValidationHelper.GetInteger(actionArgument, 0); if (userId > 0) { EmailUserInfoProvider.DeleteEmailUserInfo(emailId, userId); } break; } }
/// <summary> /// Remove selected recipients from mass e-mail. /// </summary> protected void btnDeleteSelected_Click(object sender, EventArgs e) { // Get list of selected users ArrayList list = gridElem.SelectedItems; if (list.Count > 0) { foreach (string userId in list) { // Remove specific recipient EmailUserInfoProvider.DeleteEmailUserInfo(emailId, ValidationHelper.GetInteger(userId, 0)); } gridElem.ResetSelection(); gridElem.Pager.UniPager.CurrentPage = 1; gridElem.ReloadData(); } }
/// <summary> /// Remove selected recipients from mass e-mail. /// </summary> protected void HeaderActions_ActionPerformed(object sender, CommandEventArgs e) { if (e.CommandName.EqualsCSafe("delete", true)) { // Get list of selected users List <string> list = gridElem.SelectedItems; if (list.Count > 0) { foreach (string userId in list) { // Remove specific recipient EmailUserInfoProvider.DeleteEmailUserInfo(emailId, ValidationHelper.GetInteger(userId, 0)); } gridElem.ResetSelection(); gridElem.Pager.UniPager.CurrentPage = 1; gridElem.ReloadData(); } } }