473,386 Members | 1,621 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,386 software developers and data experts.

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 WindowOpenButton. But I don't want the user to have to
perform 2 clicks, so I replaced the CommandField with a TemplateField that
included the WindowOpenButton.

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

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 3374
The solution was to use the GridView_DataRowBind event to add a rowindex
attribute to each WindowOpenButton with the rowindex of the GridViewRow that
fired the event.

This can then be retrieved during the WindowOpenButton_Click even in order
to set the GridView.SelectedIndex.

OK. So it's a little more complex than that. I had to remove the Javascript
onclick code from the WindowOpenButton_OnPreRender event so that the
WindowOpenButton_Click would actually fire, and changed the
PostBack_WindowOpenButton() function to use the PostBackReferenceEvent for
the Page rather than the WindowOpenButton 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
by: ahaideb | last post by:
I have a table (relation) in my database: --------------- | parent | child | --------------- | 1 | 2 | | 1 | 3 | | 2 | 4 | | 2 | 5 ...
4
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...
2
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...
0
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...
0
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">...
3
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...
2
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...
2
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...
4
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.