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
close icon

Swim Lane drop from palette not sizing properly

Hi,

See the attached video for a demonstration of the issue.
The swimlane that is dropped is very small and does not even show the lane.
I have to drag it to get the size I want,

Here's how the palette item is created in code behind:

Lane horLane = CreateSwimLane("HorizLane", "horizontal", 140, 60);
...
private Lane CreateSwimLane(string name, string orientation, int width, int height)
    {
        Lane swimLane = new Lane();
        swimLane.Name = name;
        swimLane.Header.Text = "";
        swimLane.Header.Width = 60;
        swimLane.Header.Height = 60;
        swimLane.Header.FillColor = "#C7D4DF";
        swimLane.Header.FontSize = 11;
        swimLane.Width = width;
        swimLane.Height = height;
        swimLane.Orientation = orientation;
        swimLane.FillColor = "#f5f5f5";
        swimLane.OffsetX = 60;
        swimLane.OffsetY = 60;
        return swimLane;
    }

What am I doing wrong?

Thanks

Jim

Attachment: Syncfusion__Swim_Lane_Drop_Issue_24aa5c68.zip

4 Replies

SG Shyam G Syncfusion Team January 19, 2015 01:42 PM UTC

Hi Jim

Thanks for using Syncfusion products.

Please note that the lane rendered in the palette has it’s default value of width and height which is set in the code behind. Whenever we drag and drop the node(lane) from the palette into the diagram, then the node’s width and height will be based on the PreviewWidth and previewHeight. So we suggest you to set the width and height for the lane using the “nodeCollectionChange” event and this event triggers before the node gets added in the diagram. We have provided sample and code snippet below for your reference.

Code snippet:

DiagramContent.OnClientNodeCollectionChange = "nodecollectionchanged";

function nodecollectionchanged(args) {

if (args) {

            if (args.element && args.element.isSwimlane) {

                if (args.element.orientation == "horizontal") {

                    args.element.minHeight = 120;

                    args.element.minWidth = 450;

                }

                if (args.element.orientation == "vertical") {

                    args.element.minHeight = 450;

                    args.element.minWidth = 120;

                }

                diagram.updateNode(args.element.name, {});

            }

        } 

}   

Sample:http://www.syncfusion.com/downloads/support/directtrac/117980/diagrambuildersample1211504405.zip

Please let me know if any concerns.

Regards,

Shyam G




JJ Jim Jacobs January 19, 2015 10:33 PM UTC

Hi Shya,

The code you provided works.  Thanks

However, subsequent lanes dropped on the swimlane do not size properly.
See the attached video.

How do I fix this?

Thanks again.

Jim

Attachment: Syncfusion__Lanes_Dropped_Not_Sized_Correctly__19Jan2015_15b4c23b.zip


JJ Jim Jacobs January 19, 2015 10:34 PM UTC

Shyam, sorry about leaving the "m" off your name.
Jim


SG Shyam G Syncfusion Team January 20, 2015 05:32 AM UTC

Hi Jim

Thanks for the update

We have analyzed your requirement with our sample and we are unable to reproduce the reported issue at our end. Could you please provide us more details such as sample or share us a sample script file that you have used in your application or modify the below sample to reproduce the reported issue at our end?. This will help us to verify and provide better solution to you. please refer the below sample and video for your reference.

Sample:http://www.syncfusion.com/downloads/support/directtrac/117980/diagrambuilder972757057.zip

Video: http://www.syncfusion.com/downloads/support/directtrac/117980/nodelane2078322250.zip

Please let me know if any concerns.

Regards,

Shyam G



Loader.
Live Chat Icon For mobile
Up arrow icon