开发者

silverlight 4 and Refresh Parent Window when Child Window closed

开发者 https://www.devze.com 2023-01-21 12:40 出处:网络
In my SL4 App I have a Parent Page where I\'m displaying a datagrid. I open the ChildWindow when the user selects aparticular Row in the grid and clicks on Open button using the following code.

In my SL4 App I have a Parent Page where I'm displaying a datagrid. I open the ChildWindow when the user selects a particular Row in the grid and clicks on Open button using the following code.

cwEditProduct ChildWin = new cwEditProduct(productId);
ChildWin.Closed += new EventHandler(ChildWin_Closed);
ChildWin.Show();

and When the user closes the ChildWindow the following code runs but it is not refreshing the parent grid with updates.

void ChildWin_Closed(objec开发者_如何学Got sender, EventArgs e)
    {
        LoadProducts();
    }

If I go to another page and come back to this it works fine but not from the childWin closed event.

I have noticed during the debugging that the ChildWin_Closed gets called soon I press the Close button on the Child Window and it runs the remaining code in the close button and then closes the window. Is it just because of timing or I'm doing something wrong??

Any response would be much appreciated


Got it working. Need to clear the cache

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号