private void PerformRowDelete() { try { NameValueCollection values = new NameValueCollection(); foreach (String text in HttpContext.Current.Request.Form.Keys) { values[text] = HttpContext.Current.Request.Form[text]; } GridRowDelete e = new GridRowDelete(); e.RowKey = values["id"]; HandleDelete(e); } catch (Exception ex) { throw ex; } }
private void HandleDelete(GridRowDelete e) { try { IEnumerable retrievedData = (IEnumerable)HttpContext.Current.Session[SessionVarName]; foreach (Object obj in retrievedData) { if (((BaseItem)obj).VID == e.RowKey.ToInt()) { ((BaseItem)obj).Delete(); return; } } } catch (Exception ex) { throw ex; } }