SfDiagram bug? I can't set PageBackground of PageSettings to Transparent when I put SfDiagram in ListView. What do you know?

I can't set PageBackground of PageSettings to Transparent when I put SfDiagram in ListView. What do you know?

Attachment: listinsfdiagrambugsample_37b71210.zip

7 Replies 1 reply marked as answer

RA Ranjitha Amirthalingam Syncfusion Team September 2, 2020 02:10 PM UTC

Hi Jun, 
 
Thanks for contacting Syncfusion Support. 
 
We could face that white region appears for node in list view even though PageBackground of PageSettings is transparent. Currently, we are validating the root cause of the issue and will update you further details on September 4, 2020. 
 
We appreciate your patience until then. 
 
Regards, 
Ranjitha A. 



JM Jun Maeda September 4, 2020 09:03 AM UTC

thanks you.

Maybe `syncfusion:SfDiagram.ScrollSettings` is not set properly in ListView, is it? (If you prepare a node that exceeds the range, you cannot hide the scroll bar.)


RA Ranjitha Amirthalingam Syncfusion Team September 4, 2020 03:05 PM UTC

Hi Jun, 
 
ScrollSettings and PageSettings properties were initialized with default values in the SfDiagram's Constructor. While you using SfDiagram as DataTemplate, the property which is already initialized doesn't gets updated for xaml values.  
So,we have solved this issue by creating custom class for SfDiagram and updated the properties in the constructor of the custom class. Then use that custom Diagram in the template to achieve your requirement. Please refer the code changes as below. 
 
Code changes: 
<local:CustomDiagram Background="Yellow" Height="120" Width="120" Tool="None" HorizontalRuler="{x:Null}" VerticalRuler="{x:Null}">
                        <local:CustomDiagram.Nodes>
                            <syncfusion:NodeCollection>
                                <syncfusion:NodeViewModel UnitHeight="50" UnitWidth="50" OffsetX="30" OffsetY="30" />
                            </syncfusion:NodeCollection>
                        </local:CustomDiagram.Nodes>
</local:CustomDiagram>
 
 
public class CustomDiagram : SfDiagram
    {
        public CustomDiagram() : base()
        {
            this.PageSettings = new PageSettings() { PageWidth = 100, PageHeight = 100, PageBackground = new SolidColorBrush(Colors.Transparent) };
            this.ScrollSettings = new ScrollSettings() { ScrollLimit = ScrollLimit.Diagram, DragLimit = ScrollLimit.Diagram, AutoScrollLimit = ScrollLimit.Diagram };
        }
    }
 
 
 
  
 
Regards, 
Ranjitha A. 


Marked as answer

JM Jun Maeda September 7, 2020 06:13 AM UTC

thank you. It went well.

Does that mean that you should create a DependencyProperty that inherits and works together? Although the OnInitialized function requires initialization.

add class:

set style:
https://github.com/juner/ListInSfDiagramSample20200902/blob/3bf06763966e12d69a81d978b076597d460433d5/ListInSfDiagramSample/MainWindow.xaml#L29-L42

Attachment: ListInSfDiagramSample20200902_833e2dd6.zip


RA Ranjitha Amirthalingam Syncfusion Team September 7, 2020 02:51 PM UTC

Hi Jun, 
 
Yes , the solution you provided is the way to update the properties(PageSettings,ScrollSettings) for diagram through style in Xaml. Could you please let us know whether you require any further assistance on this? 
 
 
 
Regards, 
Ranjitha A. 



JM Jun Maeda September 8, 2020 12:38 AM UTC

No, so far it doesn't seem to matter.
Thank you very much.


RA Ranjitha Amirthalingam Syncfusion Team September 8, 2020 08:38 AM UTC

Hi Jun, 
 
Most Welcome. 
 
Regards, 
Ranjitha A. 


Loader.
Up arrow icon