Mar 9, 2009 at 10:37 PM
Edited Mar 9, 2009 at 10:47 PM
I am accessing a WCF service through my WPF DataGrid which works fine at run time. But I am trying to get the right XAML setup so I can customize the DataGrid object in the designer.
I keep getting a "endpoint error" in the designer at Design time when I setup my ObjectDataProvider as a Windows resource so I can bind the DataGrid in XAML using the ItemsSource keyword.
"Could not find default endpoint element that references contract
in the ServiceModel client configuration section. This might be because no configuration file was found
for your application, or because no endpoint element matching
this contract could be found
in the client element."
<!-- create an instance of our DataProvider class -->
I had the same problem. It has something to do with the designer trying to init the WCF client and failing, or trying to execute your ObjectDataProvider method. In my case I put both of these sections in the code into try-catch blocks and that
public TaskObjects GetTasks()
TaskObjects tasks =
Task dbTasks =
dbTask in dbTasks)
The other thing that can cause the designer to fail to enumerate the ObjectDataProvider is if your GetWhateverDataFromWCF() method returns null on exception/failure. As you can see in my method I return an empty collection. Once I did that the designer suddenly