Is that possible to edit a record within a gridview on 2 rows to make it look better when editing?
Like I have 8 columns in my gridview.
I wish to have 4 columns on row one and the 4 remaining columns on row 2.
View Complete Post
using Asp.net c#
i am searching a record from my database and displaying it in gridview now i want the comments should be updated as per the record which is being searched
For E.g if record No.3 is searched then only i can update record no.3 and i don't want rest of data to be shown
now what is happening when i click on edit my whole table is being displayed
this is bcuz i made one method gridfill() which i m calling everytime if i m doing grid row editing,row cancelling and row updating
how i can resolve this thing
protected void GridView2_RowEditing(object sender, GridViewEditEventArgs e)
GridView2.EditIndex = e.NewEditIndex;
protected void GridView2_RowUpdating(object sender, GridViewUpdateEventArgs e)
string id = GridView2.Rows[e.RowIndex].Cells.Text;
t = (TextBox)GridView2.Rows[e.RowIndex].Cells.Controls;
string query = "update user1 set comments=@comments where id=@id";
SqlConnection con = new SqlConnection(connstr);
SqlCommand cmd = new SqlCommand(query, con);
I have a dynamically created gridview where I could have 13 columns at max or 7 at min with some boundfields from a dataTable as well as a templatefield for a button. I would like to make 3 of these databound columns editable across all rows when the gridview is rendered. I believe I need to replace the boundfields of the columns I want keep open for editiing with templatefields. However, I am having difficulty in passing the values from the Datatable into the template fields. I can't hard code the Templatefield like many examples show. I need the template field to be created through the Datatable loop and then bound to the gridview. Any advice would be greatly appreciated.