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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

how to intialize diagram scroll bar position and range

Thread ID:

Created:

Updated:

Platform:

Replies:

54706 Jan 15,2007 09:45 PM UTC Jan 22,2007 03:07 PM UTC Windows Forms 8
loading
Tags: Diagram
Lan
Asked On January 15, 2007 09:45 PM UTC

Hi,
V4.4.0.51 and VS.NET 2003

I used following similar code to load a diagram from a table BLOB, then set up the initial scroll bar position to (0,0). But my code does not work. How can I setup the scroll bar to (0,0)- X bar to the most left, Y bar to the most top? and the scroll bar ranges?
Thanks,

Lan

//load tree to diagram from a stream stored in BLOB field
LoadTree();
//initilize view
diagram.View.PageSettings.Landscape=true;
diagram.View.PageSettings.Bounds.Width=600
diagram.View.PageSettings.Bounds.Height=400
this.diagram.Model.Width=600
this.diagram.Model.Height=400
//set view Magnification to 100
this.diagram.View.Magnification = new System.Drawing.Size(100, 100);
// set scroll bar initial position to (0,0)
this.diagram.View.ScrollBy(0,0); // not work
this.diagram.UpdateScrollRange();
this.diagram.UpdateScrollBars();
this.diagram.View.Update();




scroolbar.zip

J.Nagarajan [Syncfusion]
Replied On January 16, 2007 10:48 PM UTC

Hi Lan,

If your intention is to set the scroll bar's initial position to origin then you can use the value property of HScrollBar and VScrollBar. Please refer to the following code snippet

this.diagram1.HScrollBar.Value=0;
this.diagram1.VScrollBar.Value=0;

I hope this will meet your requirement. Please let me know if you have any questions.

Thanks,
Nagaraj

Lan Mo
Replied On January 17, 2007 02:36 PM UTC

Hi,
Yes, the scroll bar position is OK now. How about the view position? The attached ViewPosition.jpg shows the view position is not at (0,0). This diagram is saved into BLOB field when the view position is not at (0,0) by 'Pan Tool" and loaded again from BLOB. I want it to be at (0,0) after loading from BLOB as attached
ViewPosition_OK.jpg. What property I need to set?
Thanks,

Lan

ViewPosition.zip

Administrator [Syncfusion]
Replied On January 17, 2007 02:43 PM UTC

Hi,
I forgot to attach my code for set up position:

//Loading diagram from stream stored in BLOB field
LoadTreeFromDB();

// set scroll bar and diagram view to (0,0)
this.diagram.HScrollBar.Value=0;
this.diagram.VScrollBar.Value=0;
this.diagram.View.Location=new Point(0,0); //this doesn't set view to (0,0)
this.diagram.Update();


Lan

J.Nagarajan [Syncfusion]
Replied On January 17, 2007 05:06 PM UTC

Hi Lan ,

We regret for the inconvenience caused. I have tested this issue in v.4.4.0.51. I am afraid, I was not able to reproduce this issue. I have attached my test sample.

View Position.zip

Could you please check the sample and let me know whether you are able to reproduce the issue in this sample?. It would be helpful if you provide a sample or modify the sample attached to reproduce this issue.It will help us to resolve it as early as possible.

Thanks for using Essential Diagram.

Regards,
J.Nagaraj

Administrator [Syncfusion]
Replied On January 17, 2007 06:37 PM UTC

Hi,
Thank you for help.

I modified your sample by adding "PanTool" in your menu so that you can add some sysmbol nodes then Click menu 'Pan' to drag the diagram view off the (0,0), save it to file. Open the file again to diaplay the diagram. I want the diagram view is at (0,0).

Please see the "a.edp" file saved.




Lan




Administrator [Syncfusion]
Replied On January 19, 2007 03:24 PM UTC

Hi,
I am sorry your sample diagram does not work the way I like.

I've modified your sample by adding "PanTool" in your menu so that you can add some sysmbol nodes then Click menu 'Pan' to drag the diagram view off the (0,0) position, then save it to a file such as "a.edp". Open the file "a.edp" again to diaplay the diagram. You will notice this diagram's view does not display at (0,0).
I want after the diagram has been loaded from a file 'a.edp', set the diagram view position to (0,0) by code.

Thanks,

Lan


View Position.zip

J.Nagarajan [Syncfusion]
Replied On January 19, 2007 07:36 PM UTC

Hi Lan,

Sorry for the delay in getting back to you. I was able to visualize the condition that you have mentioned here. If your intention is to set the view position of the diagram to (0,0) then you have to set the Origin property of View class to (0,0). Please refer to the following code snippet.

this.diagram1.Controller.View.Origin=new Point(0,0);
this.diagram1.HScrollBar.Value=0;
this.diagram1.VScrollBar.Value=0;

I have attached the sample that demonstrates this completely. Please refer to it and let me know if you have any questions.

Thanks,
Nagaraj

View Position.zip


Administrator [Syncfusion]
Replied On January 22, 2007 03:07 PM UTC

Thank you. It works well for me.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;