This is a migrated thread and some comments may be shown as answers.

Adjusting the location of a control at runtime

1 Answer 134 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sivam
Top achievements
Rank 1
Sivam asked on 14 Jun 2010, 03:31 PM
Hi,

I have panel. At design time, Panel1.Location.X is 9.23cm. At run time i want to change it to 0.03cm. here is the code.

Panel1.Location.X.Add(

new Telerik.Reporting.Drawing.Unit(0.03, Telerik.Reporting.Drawing.UnitType.Cm));

But i don't see it gets changed. I've another panel at Location.X = 0.03cm which is made invisible at runtime. Is there anyway to change the location of control at run time?

Thanks in advance.

 

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 15 Jun 2010, 01:43 PM
Hello Sivam,

Adjusting the item positions at runtime is not that easy as specifying its position. For one, you should be aware of which format you're going to render the report into. For example you cannot have overlapping items in HTML and Excel rendering, thus no matter the actual location you specify, if the item overlaps with another one, it would be automatically moved by the rendering engine.
Another thing to have in mind is the item dependency in a report. An item can only occupy another item's location if there aren't any items with the same Y location as the one made invisible e.g. if you have two textboxes with equal Y location and you hide the left one, if there is a textbox below it, it would not go up because the right one is still there.
Whenever you want to "break" item location dependency, one should use container item such as Panel. Items which are children of different panel parents do not depend on each other.

Best wishes,
Steve
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Sivam
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or