Update complete parent page from child window RRS feed

  • General discussion

  • Hi,

    I have a silverlight datagrid on a Parent page with hyperlink, When we click on that link child window opens.

    We enter a value in a child window textbox and that value we want to update in Parent window.

    We are taking the value from database on parent page.

    we have already use following ways:

     1. Call the parent page constructor on the child window.

        Ex. : MainPage();

    2. Call the function which bind the datagrid on the parent page.


    Thursday, November 3, 2011 6:56 AM

All replies

  • If you want to read the textblock entered in child window, then have a static variable in App file which can be used a global variable in whole silvelright project, assign the textblock value this variable from childwindow as

    App.variablename = txtblk.text;

    this can be access in mainpage ie parent page as 

    string txt = App.variablename;

    Thursday, November 3, 2011 7:15 AM
  • Thanks for reply Syed,

    We also want to refesh the MainPage.xaml on close of Child Window

    Thanks in Advance

    Thursday, November 3, 2011 8:03 AM
  • What do u mean by refresh ?

    you can refresh the variable or the specific usercontrol or any container in parent page, what else you want.

    could you elaborate your question ?

    Thursday, November 3, 2011 8:26 AM
  • I want to Refresh the Datagrid on the Mainpage.xaml on when I close the Child window.

    Thanks in Advance

    Thursday, November 3, 2011 8:42 AM
  • yes, reassign the itemsource to datagrid in mainpage it will refresh the datagrid.

    when you open the childwindow in mainpage, iniatilize the ok button in mainpage too, so that u can reassign the itemsource.

    if your dataclass is implemented from INotifyPropertyChanged then no need of Reassigning the itemsource.

    Let me know if you want anything else.

    Thursday, November 3, 2011 9:27 AM
  • Hi Syed,

    Thanks for the reply but we have tried it.

    But its not working. Is there any other way, we can refresh it.



    Thursday, November 3, 2011 9:36 AM
  • Hey Rahul,

    It will work, i did many a times.

    if possible send me the code , i will help you in coding.

    Thursday, November 3, 2011 9:51 AM