protected void m_grid_RowDeleting(object sender, GridViewDeleteEventArgs e) { string message = ""; try { CustomerFields m_CustomerFields = new CustomerFields(); m_CustomerFields.CustomerFieldId = System.Int32.Parse(m_grid.DataKeys[e.RowIndex].Value.ToString()); m_CustomerFields.Delete(); } catch (Exception ex) { sms.utils.Log.writeLog(ex.ToString(), ((new System.Diagnostics.StackTrace()).GetFrames()[0]).GetMethod().Name); } ShowGrid(); }
protected void lbDelete_Click(object sender, EventArgs e) { try { CustomerFields m_CustomerFields = new CustomerFields(); foreach (GridViewRow m_Row in m_grid.Rows) { CheckBox chkAction = (CheckBox)m_Row.FindControl("chkAction"); if (chkAction != null) { if (chkAction.Checked) { m_CustomerFields.CustomerFieldId = System.Int32.Parse(m_grid.DataKeys[m_Row.RowIndex].Value.ToString()); m_CustomerFields.Delete(); } } } ShowGrid(); } catch (Exception ex) { sms.utils.Log.writeLog(ex.ToString(), ((new System.Diagnostics.StackTrace()).GetFrames()[0]).GetMethod().Name); } }