Posted on: 6/30/2015 7:39:21 AM | Views : 667

hi all
i am retrieving the data from database and displaying in gridview
i have added edit and delete options to gridview
during edit iam not mentioning any colum name in the coding because user can edit the 4 tables data in  database.
so iam not mentioning the column names
i am getting the column names and column values dynamically
my code is
List<TextBox> tbxlist = new List<TextBox>(); foreach (Control item in GridView2.Rows[e.RowIndex].Controls) { foreach (Control childItem in item.Controls) { if (childItem is TextBox) { TextBox tbx = childItem as TextBox; tbxlist.Add(tbx); } }
} for (int j = 0; j < tbxlist.Count; j++) { int i = j + 1; HiddenField1.Value += GridView2.HeaderRow.Cells[i].Text + "='" + tbxlist[j].Text + "',";
}
if (!string.IsNullOrEmpty(HiddenF ...

Go to the complete details ...