473,699 Members | 2,506 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parent/Child CC In GridView

I have a parent page with a gridview, and a child page with a formview.

Using the solution on velocityreviews :

http://www.velocityreviews.com/forum...ialog-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 window with the details, and when the FormView
was updated the GridView of the parent was refreshed without closing the
child.

This was by using a CommandField to perform the Select of the row, and then
clicking on the WindowOpenButto n. But I don't want the user to have to
perform 2 clicks, so I replaced the CommandField with a TemplateField that
included the WindowOpenButto n.

Unfortunately, while I was able to pass the DataKey to the Child form using
a URL parameter, the SelectedIndexCh anged event doesn't fire as the
Javascript onclick event stops the custom control from processing the
CommandName="Se lect".

Any ideas on how I might solve this?

This is, the select button for a row in the GridView changes the
SelectedIndex *then* fires the Javascript "window.open".. .

TIA
Dec 1 '06 #1
1 3390
The solution was to use the GridView_DataRo wBind event to add a rowindex
attribute to each WindowOpenButto n with the rowindex of the GridViewRow that
fired the event.

This can then be retrieved during the WindowOpenButto n_Click even in order
to set the GridView.Select edIndex.

OK. So it's a little more complex than that. I had to remove the Javascript
onclick code from the WindowOpenButto n_OnPreRender event so that the
WindowOpenButto n_Click would actually fire, and changed the
PostBack_Window OpenButton() function to use the PostBackReferen ceEvent for
the Page rather than the WindowOpenButto n control (otherwise every time you
postback via the child window, another child window appears).

But I finally got it all to work so that clicking on the Select button of a
row in the GridView, highlights the row then opens a popup window (cannot
use modal, of course), that shows the detail in a FormView. Clicking Update
on the FormView updates the data and refreshes the GridView without closing
the child window. Clicking on the Delete button on the FormView refreshes
the GridView and closes the child window.


Dec 1 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
9120
by: ahaideb | last post by:
I have a table (relation) in my database: --------------- | parent | child | --------------- | 1 | 2 | | 1 | 3 | | 2 | 4 | | 2 | 5 | | 3 | 6 |
4
4564
by: Danny Tuppeny | last post by:
Hi all, I've been trying to write some classes, so when I have a parent-child relationship, such as with Folders in my application, I don't have to remember to add a parent reference, as well as adding to the child collection, eg: parent.Children.Add(child); child.Parent = parent;
2
1652
by: ads | last post by:
hi guys, Here's the scenario: i have a gridview on a parent page. Then i open another (child) page where i can modify the data on the dridview. How do i update the gridview soon as i do modification and close the child window ? I just need a triger event to rebind the gridview but how can i do that from the child page? Thanks in advance,
0
8563
by: Innova | last post by:
Hi, We are working on a gridview inside the gridview (parent-child) scenario. The data of child grid will depend on the data of parent. Objectives: 1.Add new row in parent grid after each row and add child grid into that row because the columns in child grid are same as parent grid and we want to align them with the cols of parent grid. 2. If there is data for child grid we show a plus image in the parent row (in the row above the...
0
1018
by: linushung | last post by:
I'm trying to use a pop-up page to accept user input then send those values to the parent page to rebind a gridview control, here's the scenario: Parent: <script type="text/javascript"> function OpenWindow() { window.open("child.aspx", "Child",
3
3070
by: Joe | last post by:
I need to popup a window, allow the user to select an image, update the parent window with this new value (requires a refresh) and then close the child window. Are there any examples of something similar to this? Thanks, Joe
2
3822
by: =?Utf-8?B?U2lsa0NpdHlGbG9yaWRh?= | last post by:
I have a web page "PgA" with a GridView. I open another page "PgB" in a new window. On PgB, they do some things that affect the underlying data for the GridView on PgA. When the user is done with PgB, they click a button that executes this VB: Protected Sub Close_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Close.Click 'Do some stuff Response.Write("<script language='javascript'{...
2
3722
by: satyabhaskar | last post by:
hi all, how to bind gridview in parent window to the child window using client side java script....actually in my main page i have a grid view consisting a report... my problem is to display that grid which consists report in a new window..can any one plz solve my problem thanks
4
1822
by: KMSDXB | last post by:
Hi, I have three forms. "Main form" is a container and "Logon Form" is the child of this. I want to invoke another "AppLogin Form" from "Logon Form" as a child form to get the login details to a diff application. How can this be done? If I make the Logon form as a container, its giving me the error " A form cannot be container and child..... ".Please do reply Thanks in advance, KMSDXB
0
8615
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,...
1
8911
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8882
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7748
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
5872
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4375
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...
1
3057
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
2
2345
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2009
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.