Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void gvInvoicePart_RowDeleting(object sender, GridViewDeleteEventArgs e)
- {
- try
- {
- SetRowData();
- if (ViewState["CurrentTable"] != null)
- {
- DataTable dt = (DataTable)ViewState["CurrentTable"];
- DataRow drCurrentRow = null;
- int rowIndex = Convert.ToInt32(e.RowIndex);
- if (dt.Rows.Count > 1)
- {
- dt.Rows.Remove(dt.Rows[rowIndex]);
- drCurrentRow = dt.NewRow();
- ViewState["CurrentTable"] = dt;
- gvInvoicePart.DataSource = dt;
- gvInvoicePart.DataBind();
- for (int i = 0; i < gvInvoicePart.Rows.Count - 1; i++)
- {
- gvInvoicePart.Rows[i].Cells[0].Text = Convert.ToString(i - 1);
- }
- SetPreviousData();
- }
- }
- }
- catch (Exception Ex)
- {
- LogEntry.Write("ClientToDoList_Invoice_gvInvoicePart_RowDeleting", Ex);
- Response.Redirect("../ErrorMessage.aspx", false);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement