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

AddNewDataItem event in XBAP

3 Answers 62 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Datafyer
Top achievements
Rank 1
Veteran
Datafyer asked on 26 Apr 2011, 06:44 PM
I have a WPF application which calls a dialog using the ShowDialog method and then sets the e.NewObject of the GridView event to the newly created row. Everything works very well, however I am attempting to change the ShowDialog calls to remove the synchronous actions. This is to get the code working in an XBap environment and to get it closer to Silverlight if a port is needed.

I am however baffled as to how to do this without blocking the UI thread to wait for the dialog information.

This is basically what I am doing now:

RadWindow NewWindow = new RadWindow();
  
NewWindow.ShowDialog();
e.NewObject = NewWindow.NewRow;

This is what I would like to do

RadWindow NewWindow = new RadWindow();
  
NewWindow.Closed += delegate
{
  e.NewObject = NewWindow.NewRow;
};
  
NewWindow.Show();

3 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 27 Apr 2011, 01:38 PM
Hello Patrick,

 


Since you open your window as a normal window through calling the Show() method the UI behind this window will be still active and responsible to the end user.
I have prepared sample project illustrating how you may achieve a similar scenario to yours.
Please have a look at it and let me know how it corresponds to your custom needs. 


Regards,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Datafyer
Top achievements
Rank 1
Veteran
answered on 28 Apr 2011, 07:35 PM
What is the difference behind the scenes between adding an item by setting e.NewObject and by adding it directly to the bound list?
0
Yavor Georgiev
Telerik team
answered on 28 Apr 2011, 08:20 PM
Hi Patrick,

 Please check my post in your other thread here.

All the best,
Yavor Georgiev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Datafyer
Top achievements
Rank 1
Veteran
Answers by
Vanya Pavlova
Telerik team
Datafyer
Top achievements
Rank 1
Veteran
Yavor Georgiev
Telerik team
Share this question
or