GridView Inside GridView
An article on how to use GridView control available in ASP.Net 2.0 having multiple controls in template inside it.
The text of this article is not in this database — only its details are. The old site it was published on is gone, but the Internet Archive kept a copy: GridView Inside GridView
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.
Dorababu MekaPosted Apr 3, 2012, 4:58 AM
I would like to find the child gridview outside the existing event how can I My code private void SaveCheckedValues() { ArrayList userdetails = new ArrayList(); int index = -1; GridView gv = (GridView)gvCustomers.FindControl("gvOrders"); // Unable to find child grid view here foreach (GridViewRow gvrow in gv.Rows) { index = (int)gv.DataKeys[gvrow.RowIndex].Value; bool result = ((CheckBox)gvrow.FindControl("chkBoxChild")).Checked; // Check in the Session if (Session["CHECKED_ITEMS"] != null) userdetails = (ArrayList)Session["CHECKED_ITEMS"]; if (result) { if (!userdetails.Contains(index)) userdetails.Add(index); } else userdetails.Remove(index); } if (userdetails != null && userdetails.Count > 0) Session["CHECKED_ITEMS"] = userdetails; }
SrinivasPosted Aug 25, 2010, 9:27 PM
You have done very good but i got error while running that program in the mastertable.xsd at line 766 it saying invalid object name mater table. Regards Srinivas
jaya prakashPosted Aug 11, 2010, 12:32 PM
its good
Alok DasPosted Mar 11, 2008, 1:26 PM
I have a gridview which contains 5 columns named date,code,type,name,detailed . I want to make rowupdating function n rowdeleting function on that gridview . can u write a code for that ? The first 4 fields are in a table & code is the p.key n there is a another table which contains code & detailed . PLZ SEND THE CODE TO MY MAIL.
Alok DasPosted Mar 11, 2008, 1:15 PM
Suppose there are 5 columns in a gridview . we want to update and delete function on gridview.how could i write code for that. i write the code as below but it show as error ---------------------------- protected sub GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) int s4 = (int)GridView1.DataKeys[e.RowIndex].Value string ss1 = "delete from dept where emp_id='" + s4 + "'" //delete(ss1) adc.delete(ss1) GridView1.EditIndex = -1 show_grid(); protected sub GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) TextBox t1, t2, t3 = new TextBox() t1 = (TextBox)GridView1.Rows[e.RowIndex].Cells[0].Controls[0] string s1 = Convert.ToString(t1.Text) t2 = (TextBox)GridView1.Rows[e.RowIndex].Cells[1].Controls[0] string s2 = t2.Text t3 = (TextBox)GridView1.Rows[e.RowIndex].Cells[2].Controls[0] string s3 = t3.Text int s4 = (int)GridView1.DataKeys[e.RowIndex].Value string ss = "update dept set dept_id='" + t1.Text + "',dept_name='" + t2.Text + "',dept_acc='" + t3.Text + "' where emp_id='"+s4+"'" update(ss) GridView1.editIndex = -1 show_grid()
Alok DasPosted Mar 11, 2008, 1:02 PM
This is great article on gridview's different functionality. I want to know the email id of this article Mr. Nikhil . Thanks Nikhil for sharing this article with us.
mohan kumarPosted Apr 25, 2007, 9:15 AM
hi iam mohan i have doubt in dridview control . in real time enviroment grirdview control wizard update,delete,paging,sorting events are working or not ? please tell me code for update,delete ,sorting ,paging in girdview 2.0 control .i am waiting for ur reply. thank you, mohan
mayank chaturvediPosted Feb 9, 2007, 8:36 AM
how do i apply with using VB code
NewbiePosted Aug 24, 2006, 11:21 PM
Hi Nikhil I've successfully done the nested gridview. I'd like to be able to export it ? How would I go about this ? TIA
NewbiePosted Jun 21, 2006, 9:44 PM
Hi Can this be done using Sqldatasource ? Would you be able to provide some guidance here ? TIA