protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { string spid = GridView1.DataKeys[e.RowIndex].Value.ToString(); try { Label lblspID = (Label)(GridView1.Rows[GridView1.EditIndex].Cells[0].FindControl("lblspID")); TextBox txtName = (TextBox)(GridView1.Rows[GridView1.EditIndex].Cells[1].FindControl("txtName")); TextBox txtDescription = (TextBox)(GridView1.Rows[GridView1.EditIndex].Cells[1].FindControl("txtDescription")); if (LLDDAL.UpdateSPDescription(lblspID.Text, txtDescription.Text) > 0) { ErrorMessage = "Updated....."; } else { ErrorMessage = "No action done."; } GridView1.EditIndex = -1; LoadData(); } catch (Exception exc) { ErrorMessage = exc.Message; } }
private void LoadData() { try { if (txtSearch.Text.Length > 0) { string search = txtSearch.Text.Split('-')[0].ToString(); GridView1.DataSource = LLDDAL.GetObjectList(search, 5000, ""); GridView1.DataBind(); } else { GridView1.DataSource = LLDDAL.GetFullSPData(); GridView1.DataBind(); } } catch (Exception exc) { ErrorMessage = exc.Message; } }
public List <DatabaseObject> GetObjectList(string prefixText, int count, string contextKey) { return(LLDDAL.GetObjectList(prefixText, count, contextKey)); }