473,401 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

how to edit child gridview record

8
I am facing the problem in editing records in child gridview which i have placed in the parent gridview's cell. I have bound both parent and child with different sqlDataSource objects.

I have written following code to papulate child gridview and given Edit/Update column in it.

protected void gvMaster_RowDataBound(object sender, GridViewRowEventArgs e)
{
int intMAsterID1;
if (e.Row.RowType == DataControlRowType.DataRow)
{
GridView grd = new GridView();
grd = e.Row.FindControl("gvChild") as GridView;
intMAsterID1 = Convert.ToInt32(e.Row.Cells[1].Text);

if (grd != null)
{
grd.DataSourceID = "";

string mySQL = "SELECT ...FROM.... WHERE....a.id=" + intMAsterID1;


sqlDataSourceChild.SelectCommand = mySQL;
grd.DataSource = sqlDataSourceChild;
grd.DataBind();
}
}
}

When I click the Edit link in the child gridview then nothing happens but the page refreshes

Please give me solution
Thanks
nitinp
Aug 17 '06 #1
0 2858

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: drakuu | last post by:
Hello there, I have DataGrid with some records and I would like to edit it right in the datagrid using the built in commands. I can't figure out a way to pass to the SQL query the record ID...
3
by: misiek | last post by:
Hi all. I have following problem: 1. In my web page I have a GridView control, which does not have a DataSourceId set in designer. 2. When user presses Start button then I create...
1
by: Andrew Hayes | last post by:
I have a parent page with a gridview, and a child page with a formview. Using the solution on velocityreviews: ...
1
by: Dica | last post by:
i need to allow the user to select a row from my dataGrid for editing. as such, i include the record ID in the first column and then extract like so when retrieving the record details: protected...
2
by: David Ching | last post by:
I am not getting any response to my previous question on reusing a DetailsView to insert and edit the selected row in a GridView. So I'll ask an even more basic question. Newbie alert! ;) When...
1
by: shapper | last post by:
Hello, In have a web page layout with various panels. One panel contains a GridView and other panel contains various TextBox, DropDownList, etc. When I click a a GridView row I make visible...
1
by: ma | last post by:
Hello, I want to have a page that displays the fields of a record of a database. When user press 'Edit' button, he would be able to edit the data. What is the best way to do this? What I...
1
by: J | last post by:
I like the Edit (Update, Cancel) functionality built into the gridview, but I'd like to control what happens when the Update is clicked. I would like to prompt the user with something like this...
12
by: dorandoran | last post by:
I followed this link to add new record from gridview. So far it's good but I need to modify the last piece to edit the record that I will supply the record id. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.