.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Creating a Child Window in WPF GRID

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :WPF


I'm using a grid that has a WindowsFormHost element in it and in the WindowsFormHost I have a win32 ActiveX control running this is working fine. I would like to place a set of WPF controls over the ActiveX object, I understand that the ActiveX object will always be the top most item so in order to place my controls on top I will need to create a separate window and put the controls in to it. I have looked at using a popup but would have to write extra code to get it to follow the main window if it's position changes and also size. What I'd like to do is create a new window and make it a child of the Grid to display the controls in. My questions are:

1) Can I attach the window as a child of the grid?

2) Would I need to change the zorder of the child window to ensure it was above the activex control?

3) Example code if possible would help.



View Complete Post

More Related Resource Links

way of calling "javascript function of parent window from child window."

The article way of calling "javascript function of parent window from child window." was added by raja.s on Sunday, June 06, 2010.

Hi,Here i am going to explain how to call the javascript function of a parent window from the child window(pop-Up).Some may know before reading this post.Parent Java Script Function:script language="Javascript" type="text/javascript">

Timeout child window problem

The users of our site have reported a problem where when you have a child window open and click around in the main window, the child window will time out even though there is activity in the main window. We use an encryptedFormsAuthenticationTicket and http cookie that expires after a timeout period using Response.Cookies.Add(authCookie). Is there an obvious problem from this description? We are using the back button prevention like so:   Response.AppendHeader("Cache-Control", "no-cache") Response.AppendHeader("Cache-Control", "private") Response.AppendHeader("Cache-Control", "no-store") Response.AppendHeader("Cache-Control", "must-revalidate") Response.AppendHeader("Cache-Control", "max-stale=0") Response.AppendHeader("Cache-Control", "post-check=0") Response.AppendHeader("Cache-Control", "pre-check=0") Response.AppendHeader("Pragma", "no-cache") Response.AppendHeader("Keep-Alive", "timeout=3, max=993") Response.AppendHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT")  Could this cause timeout problems in child windows? Any suggestions?

Call parent window Page_Load when child closes

 I have a popup window that I open using  window.showModalDialog('Popup.aspx'); The client enters some information and then clicks a 'Save' button on the Popup window.  At that point I want the popup window to close and refresh the parent window which I though would execute the page_load event on the parent window. Here is the code that I have for the button click on the popup window. window.returnValue = true; window.close(); The popup window closes and it seems like the parent refreshes, but the page_load event on the parent is not called.  I put in a breakpoint to verify.  I need the page_load event to execute.   Thanks in advance for your help, JZ

I want to open a web page (.aspx page,child window from parent window) without titlebar how can we d


Hi All,

i have some special requirement like , i want to open a web page (child page) without a title bar for this i am following the below approach but it is not working, to open child window from parent window i am calling this javascript function to the of href of anchor tag...

function OpenChildWindow()

but the child window is opened with titlebar, but i don`t want any titlebar.

the titlebar property i was used in the above method is not working why?

how can we do this, can anybody help me...


Burepalli V S Rao.

Problem on opening child window on third time



I have a button that having an attributes as follow:

btnAddColumn.Attributes.Add("onClick", "selectDetailColumn('Type1',1); return false");

It will open a child window with the following assignment.

<script language="javascript" type="text/javascript">

        function selectDetailColumn(area, testType) {
            scLeft = (window.screen.availWidth - 600) / 2;
            scTop = (window.screen.availheight - 700) / 2;
            window.open('Details.aspx?, 'PopUp', 'width=600,height=700,top=' + scTop + ',left=' + scLeft + ',toolbars=no,scrollbars=no,status=no,resizable=no');

On this details.aspx, I have button to close the form as below:

<asp:Button ID="btnClose" runat="server" Width="80" Text="Close" OnClientClick="window.close();" />

What I did is when I open the child window, I will click on the Close button. I will repeat this process again. And on the third time I open the child window again, it wont open it, but instead the page "stays loading...".

Seems like the IIS is not responding.

Creating a Form say grid sort of a interface where in data values will be extracted from the table 4


how dis can be done help please with simple button click and changing the values it can be done but how to move columns with data in graceful manner the way we have in calendar control... 

i want to disable the entire parent window when the child window is opened?



 i am using the master page from the master page i am opening the child window.so, when ever i opened the child window i want to disable the entire parent window(all the controls present in the parent page) .how can we do it.


Burepalli V S Rao.

Creating a pivot of a collection and displaying it in a databound grid with dynamic columns



I'm trying to create a pivot of some data that I have about translation.

Basically what I have now is a collection of "Translation" objects which look like that :

Public Class SystemText
  Inherits Entity

#Region "Private variables"
  Private _textCategory As String
  Private _textName As String
  Private _languageCode As String
  Private _description As String
#End Region

#Region "Properties"
  Public Overridable Property TextCategory() As String

How to make a wpf child window follow it's parent




I've been trying to make a child window follow it's parent, I've bound the child's Top and Left properties to it's parent and that works for resizing of the parent and when the parent is dragged around the screen.  However I've hit a problem when I maximize and minimize the parent the child doesn't match it's size. I've watched the values of the parents Top and left in the debugger and it seems to get set twice once with a value that matches the new size and again with it's previous value and I guess this is whats making the child window appear incorrectly. I'm starting to think that just binding to the parents Top and Left properties isn't going to work. Is there a better approach to achieve this?



stop flickering when form child appear like normal window



I have created an application with a mdiParent and some mdichilds that when are opened they the forms are set like normal window and FormBorderStyle has value 'None'. When I call any child that is set like this, the application seems to flicker (it seems that for a very short time the child appear like a normal window wit the title bar and minimize, maximize and close button) and very quick it's ok (the title bar is disapear and the child take his place on the mdiParent). But I want to stop this flickering it is very annoying.

Can somebody tell me how can I do that? I mention that I have created this application in dot.net

Thank you in advance

TableLayoutControl exception "Error creating window handle"

I am using a TableLayoutPanel to create a report on a form. The layout is 1 column, with a 
variable number of rows added based on the number of lines in the report. As I step through
a list of reports, the layout is cleared and rebuilt. After a few iterations of this an
exception in CreateHandle is thrown. Several hundred lines are destroyed and created each
time I switch reports.

I can't find a lot of mention of the error I'm seeing. Here is one of the better ones:


tableLayoutPanel1.SuspendLayout(); tableLayoutPanel1.Controls.Clear(); tableLayoutPanel1.RowStyles.Clear(); tableLayoutPanel1.RowCount = 0; tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 30F)); tableLayoutPanel1.Controls.Add(header, 0, 0); tableLayoutPanel1.RowCount++; foreach(Measurement meas in list2) { ReportLine line = new ReportLine(meas); line.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 23F)); // "Unable to create window handle" exception here: tableLayoutPanel1.Controls.Add(line, 0, tableLayoutPanel1.RowCount); tableLayoutPanel1.RowCount++; } tableLayoutPanel1.ResumeLayout();

window.open a page from a child window



I want to ask how can i open a window from a child window....

I have a .ascx page when i click on a button i use javascript to window.open a .aspx page on this new page i want to have another button that opens another .aspx page using javascript window.open.

The problem is that window.open does not work the second time

Is there a limitation on the number of windows i can open?

How can i get the functionality that i mentioned above


Creating a Group Policy to restrict prompt window


Hi All,

I have created a Group Policy to restrict asking a prompt window in IE for Intranet Web Application with Windows Authentication enabled.

Now I want to create other than IE browsers. How can I achive that?

It would be very appreciable if any one comes up with the solution.

Thanks in Advance,

Sateesh Nagalla.

Parent and child window acess elements


If I have Parent page A.aspx and I open a child window using javascript. Then how can i acess the elements say

textbox in child window from parent page. Also how can I acess a textbox in parent page from child page. Thanks

how to shutdown a child window


dear everyone

i need to load many windows from parent window.

because i want to modify one of child windows, i don't want to shutdown all of program, just shutdown a child window of all windows what i want to modify , then load again.

i have lanuched the child window like below

 public void CreateSimPleWindow(string name)
            Thread newWindowThread = new Thread(new ThreadStart(CreateWindow));
            newWindowThread.IsBackground = true;

 public void CreateWindow()// Create new window
            MainWindow mainWindow = new MainWindow();



public void ExitWindow()//Shutdown window ,


 this.Dispatcher.InvokeShutdown();// i think this isn't real shutdown,but disappear the child window on screen look like shu

Child window getting minimized when i click on parent window using window.open



we are opening window.open pop-up as child-window from parent window. When i click on parent window then child window is getting minimized.

Is there any solution for making child-window not to be minimized when i click on parent window.

And child-window should not have minimize and maximized buttons. It should only have close button.(ie., I should be similar as ShowModalDialog ie., look and feel and functionality also).

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend