Page 1 of 1

Binding Exception in visual studio output window...

Posted: Tue Feb 01, 2011 5:00 am
by koraykazgan
Hi Stimulsoft-Guys,

we are currently evaluating the Reports.WPF 2010.3 product and have embedded it in our application (Visual Studio 2010, WPF 3.5). We have put the StiWpfDesignerControl on our wpf window and are filling its report property with an instance of StiReport class. It is working fine but if we look to output window of visual studio in debug mode, there are the following binding exceptions many times:

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'ListBoxItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'ListBoxItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')

This occurs only when we set an instance to the report property. Even if it is a brand new StiReport instance without any properties set. It only occurs in the designer, not in the viewer. Are we doing anything wrong? Or is this a bug in the designer. And if it is a bug, how quick can you fix those bugs? This is important to know for deciding, which component to buy.

Best regards,
Koray

P.S.: Here the XAML and code:

Code: Select all


    

Code: Select all

public void SetReport()
{
      Designer.Report = new StiReport();
}

Binding Exception in visual studio output window...

Posted: Tue Feb 01, 2011 8:50 am
by Alex K.
Hello,

We couldn't reproduce this bug. Could you explain your issue in more details and, if possible, send us a step-by-step guide how to reproduce the issue?
Also please send us sample project which reproduses the issue.

Thank you.

Binding Exception in visual studio output window...

Posted: Tue Feb 01, 2011 10:45 am
by koraykazgan
Hi again,

thanks for the prompt reply. We have created a sample app.
We have done the following steps:

1) Create a new WPF Application Project in Visual Studio 2010 and .Net Framework 3.5
2) Add following assembly references to project:
- Stimulsoft.Base.dll
- Stimulsoft.Report.dll
- Stimulsoft.Report.Wpf.dll
- Stimulsoft.Report.WpfDesign.dll

3) Delete the Grid and put the StiWpfDesignControl to the MainWindow.xaml as only content. Set x:Name of StiWpfDesignControl to "Designer".
4) Goto the Code-Behind of MainWindow.xaml and in the ctor after InitializeComponent() set the Report to the designer like this:
Designer.Report = new StiReport();

5) Start the app and afterwards look to the output window in Visual Studio and you'll see the following exceptions:

Code: Select all

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'NodeTreeViewItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'NodeTreeViewItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'NodeTreeViewItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'NodeTreeViewItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'NodeTreeViewItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'NodeTreeViewItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'NodeTreeViewItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'NodeTreeViewItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
As you know, these exceptions are not thrown and are not interrupting the call stack. They are only written to the output window of Visual Studio.

Hope it helps,
Koray Kazgan

Binding Exception in visual studio output window...

Posted: Wed Feb 02, 2011 6:23 am
by Alex K.
Hello,

Sorry, but we couldn't reproduce this bug.
Please check the latest prerelease build.

Thank you.

Binding Exception in visual studio output window...

Posted: Wed Feb 02, 2011 8:40 am
by koraykazgan
Hi again,

I have attached a screenshot, where the output window is displaying the exceptions after application start.
We are using:

- Windows 7 Enterprise 64-Bit English
- Visual Studio 2010 Premium Version 10.0.30319.1 RTMRel English
- .Net Framework Version 4.0.303.19 RTMRel (is installed but our project is .Net 3.5)

I have uninstalled stimulsoft and put all stimulsoft assemblies to a directory, from where I am referencing them. I have 4 stimulsoft assemblies referenced in my project (Base, Report, Report.Wpf and Report.WpfDesign). After yout last reply I have downloaded SWPF_2011.02.01_Trial.zip, extracted the content to a directory, and referenced the 4 assemblies from this directory.

BTW, I had this problem also before uninstalling stimulsoft. Therefore I don't think, it's the reason. We can reproduce this problem also on sample projects provided by stimulsoft.

Hope you have any ideas??

Regards,
Koray

Binding Exception in visual studio output window...

Posted: Fri Feb 04, 2011 12:29 am
by Andrew
Hello

Yesterday we checked your example and made our similar example with our current .dll files of the current version and did not found any problems you have described. Please watch the video and tell us what were we doing wrong?

You may download it at http://www.stimulsoft.com/private/1.zip

Thank you.

Binding Exception in visual studio output window...

Posted: Fri Feb 04, 2011 2:00 am
by koraykazgan
Hi again,

you are not looking to the correct window for the errors. The window you are looking at is the "Error List" window. But as you can see in my screenshot, I am looking to the "Output" window. In your video it is positioned left to the Error window you are looking at.

As I told erlier, WPF is suppressing binding exceptions and only showing them at debug time and only in output window. There is no popup window showing this kind of exception. At our company we are using a tracelistener to listen to the output window, and show messages, if there were exceptions thrown. So we don't miss any of them.

BTW, your video solution was nice ;-)

Hope you can get the errors now,
Regards,
Koray

Binding Exception in visual studio output window...

Posted: Mon Feb 07, 2011 1:19 am
by Andrew
Hello,

We have reproduced the error. We need some time to fix it.

Thank you.

Binding Exception in visual studio output window...

Posted: Wed Mar 02, 2011 9:05 am
by Andrew
Hello,

We have spent much time studying the problem, but have not found the reason of the issue.
We have checked all the threads with all available tools, but tools report that there is no problem. Most likely this is an internal bug of WPF.

Thank you.