This is a migrated thread and some comments may be shown as answers.

Not a but? Redisplay of Window

4 Answers 68 Views
Window
This is a migrated thread and some comments may be shown as answers.
Cuthahotha
Top achievements
Rank 1
Cuthahotha asked on 17 Sep 2008, 11:55 PM
Getting an error when trying to display a radwindow a second time.

works fine on the first time I call it.  After it closes, and I try to re-execute the code to display it, i get the following error in my generic top level silverlight error handler.

"Exception has been thrown by the target of an invocation."

I'm sure its me, but not sure what I'm missing.

Heres the code that opens the window.

private void cmdAdd_Click(object sender, RoutedEventArgs e)

{
    frmNew.Closed +=

new EventHandler<WindowClosedEventArgs>(OnWindowClosed);

    txtNew.Text =

"[Enter Item ]";

    frmNew.Show();

}

And teh code that executes on a button push from inside the form.

 

private void OnBtnOkClicked(object sender, RoutedEventArgs e)

{

    string newName = txtNewName.Text;

    frmNewUserStory.Close();

    if (newName != "")

        {

            //Doo a bunch of stuff

        }

}

 

4 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 18 Sep 2008, 10:23 AM
Hi Steve,

If you want to close and reopen RadWindow you should call the Hide method for closing. You should call the Close method only when you are done with this window again (window can be garbage collected).

If you have other questions, we will be glad to help.

Kind regards,
Hristo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Cuthahotha
Top achievements
Rank 1
answered on 18 Sep 2008, 12:26 PM
Thanks.
0
Jaime
Top achievements
Rank 2
answered on 02 Dec 2008, 07:16 PM
Hi, I have a case in which the .Close is needed.

If the window is shown over a listbox with the Drag & Drop funcionality, the Drag & Drop funcionality will stop working arround the area where the window was.

.Close() solves the problem, but it can't be shown again.

Any Ideas...??

Thanx in advance.
0
Hristo
Telerik team
answered on 03 Dec 2008, 07:40 AM
Hi Jaime,

This was problem with RadDragDropManager but it is fixed now. In the middle of december we will release service pack 2 which include this fix. If you need it earlier you need to open a support ticket and we will send you the hotfix.


Best wishes,
Hristo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
Cuthahotha
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Cuthahotha
Top achievements
Rank 1
Jaime
Top achievements
Rank 2
Share this question
or