protected void gvData_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName != "Sort" && e.CommandName != "Page") { try { if (e.CommandName == "ViewItem") { ItemID = int.Parse(e.CommandArgument.ToString()); Response.Redirect(string.Format("{0}/{1}?View=View&ID={2}&UserID={3}", SPContext.Current.Web.Url, GroupTypeItem.PAGE_URL, ItemID, UserID), false); } if (e.CommandName == "EditItem") { ItemID = int.Parse(e.CommandArgument.ToString()); Response.Redirect(string.Format("{0}/{1}?View=Edit&ID={2}&UserID={3}", SPContext.Current.Web.Url, GroupTypeItem.PAGE_URL, ItemID, UserID), false); } // Move Down if (e.CommandName == "MoveDown") { ItemID = int.Parse(e.CommandArgument.ToString()); GroupType.UpdateDisplayIndex(ItemID, "up"); Fill(); } // Move Up if (e.CommandName == "MoveUp") { ItemID = int.Parse(e.CommandArgument.ToString()); GroupType.UpdateDisplayIndex(ItemID, "down"); Fill(); } } catch (Exception ex) { SPA.Error.WriteError(ex); if (ShowDebug) { lblErrorMessage.Text = ex.ToString(); } } } }