We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Cannot find source for binding with reference : target element is 'MenuItem'

Hi,

I have many binding error with your grids :

...
System.Windows.Data Warning: 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 'MenuItem' (Name='AdvanceFilter'); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Warning: 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 'MenuItem' (Name='AdvanceFilter'); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Warning: 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 'MenuItem' (Name='PART_SortAscending'); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Warning: 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 'MenuItem' (Name='PART_SortAscending'); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Warning: 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 'MenuItem' (Name='PART_SortDescending'); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Warning: 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 'MenuItem' (Name='PART_SortDescending'); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Warning: 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 'MenuItem' (Name='PART_MenuItem'); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Warning: 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 'MenuItem' (Name='PART_MenuItem'); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Warning: 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 'MenuItem' (Name='AdvanceFilter'); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Warning: 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 'MenuItem' (Name='AdvanceFilter'); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
....

Do you know how to solve this?

It happens on every grid that contains data before the rendering.

Thanks,
A

7 Replies

RG Rajasekar G Syncfusion Team May 6, 2013 05:49 PM UTC

Hi Chaupin,

 

Thank you for your update.

 

We are able to reproduce the issue .Could you please create new incident for this issue  through Direct Trac system and we will update the status of this through incident.

 

Direct Trac Link : https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

 

Please let us know If you have any questions.

 

Regards,

Raja sekar.G



CH ChristophBasedau replied to Chaupin August 5, 2015 09:20 AM UTC

Hi,

I have many binding error with your grids :

...
System.Windows.Data Warning: 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 'MenuItem' (Name='AdvanceFilter'); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Warning: 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 'MenuItem' (Name='AdvanceFilter'); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Warning: 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 'MenuItem' (Name='PART_SortAscending'); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Warning: 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 'MenuItem' (Name='PART_SortAscending'); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Warning: 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 'MenuItem' (Name='PART_SortDescending'); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Warning: 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 'MenuItem' (Name='PART_SortDescending'); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Warning: 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 'MenuItem' (Name='PART_MenuItem'); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Warning: 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 'MenuItem' (Name='PART_MenuItem'); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
System.Windows.Data Warning: 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 'MenuItem' (Name='AdvanceFilter'); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Warning: 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 'MenuItem' (Name='AdvanceFilter'); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
....

Do you know how to solve this?

It happens on every grid that contains data before the rendering.

Thanks,
A

Hi

i am experencing the same problem with a GridDataControl of SyncFusion version 11.
The error/warnings messages are exactely the same.
My assumption is that these errors come the control template of the grid columns - since the target element is a MenuItem and the names are PART_SortAscending, PART_SortDescending and AdvanceFilter.
And the reason must be that the itemssource is not completely rendered / bound / loaded in the moment the visual ancestor is searched.

I have round 30 of these warnings when loading and my task is to detect the reason for a anoying performance problem where the data is displayed 4-5 secs after the data is generated in the view model.
We deal with small data amounts only bout 10 rows are displayed in each grid!

One of my assumptions is tha the data binding warnings and errors could by the reason for the delay.

Is there a fix or workaround for this problem?
Would it help to load the data after the views is created?

Thx,
Chris


JG Jai Ganesh S Syncfusion Team August 6, 2015 01:55 PM UTC

Hi Chris,

Sorry for the inconvenience caused.

We are able to reproduce the reported binding errors in 11.1 version but it has been fixed in our latest version. So could you please upgrade our latest version 13.2 to resolve this binding errors.

Please let us know if you need further assistance.

Thank you,

Jai Ganesh S



SM Sylvain MOUSTIQUE replied to Jai Ganesh S May 6, 2020 10:55 AM UTC

Hi Chris,

Sorry for the inconvenience caused.

We are able to reproduce the reported binding errors in 11.1 version but it has been fixed in our latest version. So could you please upgrade our latest version 13.2 to resolve this binding errors.

Please let us know if you need further assistance.

Thank you,

Jai Ganesh S


Hi,

I have many binding error with PivotGridControl and it's very slow :

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')
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')
System.Windows.Data Error: 4 : Cannot find source for binding with referenmce 'RelativeSource FindAncestor, AncestorType='Syncfusion.Windows.Controls.PivotGrid.PivotGridGroupingBar', AncestorLevel='1''. BindingExpression:Path=ItemsBorderBrush; DataItem=null; target element is 'Border' (Name='brdItem'); target property is 'BorderBrush' (type 'Brush')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='Syncfusion.Windows.Controls.PivotGrid.PivotGridGroupingBar', AncestorLevel='1''. BindingExpression:Path=ItemsBackground; DataItem=null; target element is 'Border' (Name='brdItem'); target property is 'Background' (type 'Brush')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='Syncfusion.Windows.Controls.PivotGrid.PivotGridControl', AncestorLevel='1''. BindingExpression:Path=GroupingBarItemForeground; DataItem=null; target element is 'TextBlock' (Name='PART_contentTxt'); target property is 'Foreground' (type 'Brush')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='Syncfusion.Windows.Controls.PivotGrid.PivotGridControl', AncestorLevel='1''. BindingExpression:Path=GroupingBarItemForeground; DataItem=null; target element is 'Path' (Name='sortPath'); target property is 'Fill' (type 'Brush')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='Syncfusion.Windows.Controls.PivotGrid.PivotGridControl', AncestorLevel='1''. BindingExpression:Path=GroupingBarItemForeground; DataItem=null; target element is 'Button' (Name='btnDelete'); target property is 'Foreground' (type 'Brush')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='Syncfusion.Windows.Controls.PivotGrid.PivotGridControl', AncestorLevel='1''. BindingExpression:Path=GroupingBarItemForeground; DataItem=null; target element is 'Path' (Name='path'); target property is 'Fill' (type 'Brush')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='Syncfusion.Windows.Controls.PivotGrid.PivotGridGroupingBar', AncestorLevel='1''. BindingExpression:Path=ItemsBorderBrush; DataItem=null; target element is 'Border' (Name='brdItem'); target property is 'BorderBrush' (type 'Brush')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='Syncfusion.Windows.Controls.PivotGrid.PivotGridGroupingBar', AncestorLevel='1''. BindingExpression:Path=ItemsBackground; DataItem=null; target element is 'Border' (Name='brdItem'); target property is 'Background' (type 'Brush')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='Syncfusion.Windows.Controls.PivotGrid.PivotGridControl', AncestorLevel='1''. BindingExpression:Path=GroupingBarItemForeground; DataItem=null; target element is 'TextBlock' (Name='PART_contentTxt'); target property is 'Foreground' (type 'Brush')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='Syncfusion.Windows.Controls.PivotGrid.PivotGridControl', AncestorLevel='1''. BindingExpression:Path=GroupingBarItemForeground; DataItem=null; target element is 'Path' (Name='sortPath'); target property is 'Fill' (type 'Brush')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='Syncfusion.Windows.Controls.PivotGrid.PivotGridControl', AncestorLevel='1''. BindingExpression:Path=GroupingBarItemForeground; DataItem=null; target element is 'Button' (Name='btnDelete'); target property is 'Foreground' (type 'Brush')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='Syncfusion.Windows.Controls.PivotGrid.PivotGridControl', AncestorLevel='1''. BindingExpression:Path=GroupingBarItemForeground; DataItem=null; target element is 'Path' (Name='path'); target property is 'Fill' (type 'Brush')

Please help me for fix it ?



 







Attachment: pivotGridControl_78304c7e.zip


DV Duraimurugan Vedagiri Syncfusion Team May 7, 2020 04:25 PM UTC

Hi Sylvain,

Thanks for your update.

Query : Binding error occurs in PivotGridControl and it's very slow

We are able to reproduce the binding error at our end and currently we are working on this. The fix for this issue will be include in our upcoming main release which be roll out by end of Jun 2020.

As of your mention "It's very slow". kindly brief the following things. Based on we will proceed further

Let us know at which point the PivotGridControl is very slow with replication procedure?

Are you customizing the PivotGrid control? If yes, provide the brief details of pivot customization?

Let us know your currently working version of syncfusion products?

Regards,
Durai



SM Sylvain MOUSTIQUE May 7, 2020 07:23 PM UTC

Hi Jai Ganesh S,

Thank you for your help.

I have the latest release : 18.1.0.42

In  debug mode when i load a datagrid (toolkit Microsoft on visual studio 2019), it's take 2 seconds for charged a datagrid. With PivotGridControl, it's take 2 minutes to load.
When the PivotGridControl loaded, everything is very slow : scrolling, click...

Look my settings in attached file.

Thanks in advance.

Attachment: PivotGridControl_30813a9a.zip


DV Duraimurugan Vedagiri Syncfusion Team May 8, 2020 03:07 PM UTC

Hi Sylvain,

Thanks for your update.

We have analyzed reported performance issue and prepared the sample based on your given information. But we are unable to reproduce the reported issue with the given information.

Here is the data for our testing.
Raw Record  
Pivot Column Count  
Pivot Row Count  
PivotGrid Loaded in Secs  
100k  
10  
60k  
40 – 50   

Sample: https://www.syncfusion.com/downloads/support/forum/108643/ze/PivotSample888157263.zip  

Video : https://www.syncfusion.com/downloads/support/forum/108643/ze/PivotScr1417449509.zip  

If our replication procedure is different from your actual requirement kindly modify our attached sample into issue reproducible. It would be helpful for us to provide the solution as soon as possible.

Could please provide the pivotcalculations details of PivotGrid and let us know the pivot row, column and raw data count?

Note: Please follow either this forum or following incident #276071.

Regards,
Durai



Loader.
Live Chat Icon For mobile
Up arrow icon