473,789 Members | 2,617 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to edit child gridview record

8 New Member
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_RowDat aBound(object sender, GridViewRowEven tArgs e)
{
int intMAsterID1;
if (e.Row.RowType == DataControlRowT ype.DataRow)
{
GridView grd = new GridView();
grd = e.Row.FindContr ol("gvChild") as GridView;
intMAsterID1 = Convert.ToInt32 (e.Row.Cells[1].Text);

if (grd != null)
{
grd.DataSourceI D = "";

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


sqlDataSourceCh ild.SelectComma nd = mySQL;
grd.DataSource = sqlDataSourceCh ild;
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 2870

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

Similar topics

4
9698
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 which I'm editing. SELECT: SelectCommand="SELECT ProviderID, AddressID, Address, Address2, City, State, County, Zip FROM ProviderAddress WHERE (ProviderID = @ProviderID)"
3
19265
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 programatically a dataSet, set it as a DataSource for my GridView an add it to Session. 3. I want my users to be able to edit data displayed in GridView, so I added Edit command column. 4. When user clicks Edit, then I get the following error: "The GridView
1
3397
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: http://www.velocityreviews.com/forums/t80654-solution-raising-an-event-handler-postback-on-parent-window-from-popup-child-window-dialog-box.html I was able to create the Parent and Child Window custom controls and get them to work correctly so that I could select a row in the GridView of the parent page and popup a child...
1
1822
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 void gvLocations_edit(object sender, GridViewEditEventArgs e) { // load the record details into the edit fields // GridView gvRecord = (GridView)sender; string sThisRecord = gvRecord.Rows.Cells.Text; ...
2
4382
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 the user clicks the Edit link in a GridView, is it common to use a DetailsView to edit that row instead of putting the GridView into Edit mode and editing the row in place? I would assume so, because the GridView does not typically have columns...
1
3396
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 the Form Panel so that the user can edit the data. My questions are:
1
1225
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 can suggest is to show the fields using label controls and when user press 'Edit', replace the labels with TextBox controls (setting visible
1
1447
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 "category has changed from 'something' to 'something else', shall I process related records? (yes/no)". I would also like to confirm when a user clicks Delete. Here's how I currently have the gridview configured: <asp:GridView ID="gvMyGridView"...
12
7281
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. http://asptutorials.net/ASP/gridview-auto-edit-blank-row/ I am using stored proc to insert a new record and returning the id. Now I can get the id in my asp.net (c$) environment. I added a label and I was able to populated the label with the newly added record's
0
9666
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10408
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10199
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9020
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5417
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4092
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.