
turntablistlp
Top achievements
Rank 1
turntablistlp
asked on 24 Apr 2009, 08:10 PM
Is it possible to change the parent item of an item from within the designer? If not, how can it be done in code?
I created a Panel inside of a Panel (let's call it Parent1). However, I would like to move it to a different Panel (Panel2) without having to recreate it since its contents are pretty complex. I'm not sure how to do this - when I drag the Panel, its parent is still Panel1 even if it is physically located inside Panel2.
Thanks.
I created a Panel inside of a Panel (let's call it Parent1). However, I would like to move it to a different Panel (Panel2) without having to recreate it since its contents are pretty complex. I'm not sure how to do this - when I drag the Panel, its parent is still Panel1 even if it is physically located inside Panel2.
Thanks.
4 Answers, 1 is accepted
0

turntablistlp
Top achievements
Rank 1
answered on 25 Apr 2009, 01:44 AM
It seems my problem was caused by the fact that the controls didn't exactly line up within the designer, but I couldn't initially figure out why since they appeared to line up. I'm working with a very complex report with over a hundred items (mostly textboxes), and after viewing the Report.designer.cs file, I see that all the positioning (Sizes, Locations, Heights, etc.) units for all of my elements are set to values very close to tenths of an inch, but not exactly. I do have snapping to gridlines turned on and the items appear to snap within the visual designer.
For example in my designer file I have this code for one of the textboxes,
When I should have this:
Is this normal? I don't see it happening on any of my other reports which all have a small number of items, about 10-25. This is causing my report to not always display correctly. I can solve the problems on each individual item by manually typing in the correct value either in the properties box or the designer.cs file (1.6 x 0.8 in this example) - the layout problems related to that element will disappear and display normally. However, as soon as I start working on the layout (moving any items, resizing any items, etc.) visually using the designer, the values are back to being close but not exact again.
I should also mention that the visual designer became very sluggish to operate once I had a large number of items. Any recommendations?
Thanks.
For example in my designer file I have this code for one of the textboxes,
this.textBox12.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(1.6000000238418579, ((Telerik.Reporting.Drawing.UnitType)(Telerik.Reporting.Drawing.UnitType.Inch))), new Telerik.Reporting.Drawing.Unit(0.80000019073486328, ((Telerik.Reporting.Drawing.UnitType)(Telerik.Reporting.Drawing.UnitType.Inch)))); |
When I should have this:
this.textBox12.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(1.6, ((Telerik.Reporting.Drawing.UnitType)(Telerik.Reporting.Drawing.UnitType.Inch))), new Telerik.Reporting.Drawing.Unit(0.8, ((Telerik.Reporting.Drawing.UnitType)(Telerik.Reporting.Drawing.UnitType.Inch)))); |
Is this normal? I don't see it happening on any of my other reports which all have a small number of items, about 10-25. This is causing my report to not always display correctly. I can solve the problems on each individual item by manually typing in the correct value either in the properties box or the designer.cs file (1.6 x 0.8 in this example) - the layout problems related to that element will disappear and display normally. However, as soon as I start working on the layout (moving any items, resizing any items, etc.) visually using the designer, the values are back to being close but not exact again.
I should also mention that the visual designer became very sluggish to operate once I had a large number of items. Any recommendations?
Thanks.
0
Hi turntablistlp,
Aligning items absolutely correctly has never been the purpose of the report designer. Actually as you've noticed by your experience, this can prove to be quite a tedious task especially when working with large number of items, which makes the designer a bit "sluggish" as you call it. This task becomes even harder if you take into account the fact that you are allowed to work with various measurement units and this is all being lumped together depending on the resolution you use, so that it would end up in pixels.
In other words - for precise alignment and positioning of report items, you would be better off specifying those directly through the respective Location/Size properties.
If you prefer working with the designer (although it becomes slower with increasing number of items), you can hide the snap grid and use the Layout toolbar we show in Visual Studio (more info on bottom of this help article).
Kind regards,
Steve
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Aligning items absolutely correctly has never been the purpose of the report designer. Actually as you've noticed by your experience, this can prove to be quite a tedious task especially when working with large number of items, which makes the designer a bit "sluggish" as you call it. This task becomes even harder if you take into account the fact that you are allowed to work with various measurement units and this is all being lumped together depending on the resolution you use, so that it would end up in pixels.
In other words - for precise alignment and positioning of report items, you would be better off specifying those directly through the respective Location/Size properties.
If you prefer working with the designer (although it becomes slower with increasing number of items), you can hide the snap grid and use the Layout toolbar we show in Visual Studio (more info on bottom of this help article).
Kind regards,
Steve
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0

turntablistlp
Top achievements
Rank 1
answered on 27 Apr 2009, 04:59 PM
Steve,
Thanks for the insight into why this is happening. Like you said, if I specifically enter a value (like 1.6 inches) into the Properties window using the designer, or manually edit the designer.cs file, the item stays perfectly lined up until I use the visual designer again. I've been mainly using the visual designer for formatting since that seems to be strongly recommended in the documentation, and because it's much faster than doing it manually for the layout tasks. I had just assumed all along before looking at the designer file that since I had the snap to grid turned on, and the grid was at its default of 0.1 inch, once the items snapped to the grid, they were perfectly aligned.
Is there any quick way you know of to align all the items in the report automatically? The report has over 150 items and I'd rather not have to manually go through editing everything (locations, sizes, etc.), since that will obviously take a very long time.
Thanks!
Thanks for the insight into why this is happening. Like you said, if I specifically enter a value (like 1.6 inches) into the Properties window using the designer, or manually edit the designer.cs file, the item stays perfectly lined up until I use the visual designer again. I've been mainly using the visual designer for formatting since that seems to be strongly recommended in the documentation, and because it's much faster than doing it manually for the layout tasks. I had just assumed all along before looking at the designer file that since I had the snap to grid turned on, and the grid was at its default of 0.1 inch, once the items snapped to the grid, they were perfectly aligned.
Is there any quick way you know of to align all the items in the report automatically? The report has over 150 items and I'd rather not have to manually go through editing everything (locations, sizes, etc.), since that will obviously take a very long time.
Thanks!
0
Hi turntablistlp,
The snapping is indeed turned on and as you can see the value in the InitializeComponent() is correct i.e. 1.6000000238418579. Since we're working with float, you cannot expect an integer value and even manually entered value of 1.6 would be represented as the float above.
Horizontal and vertical alignment of multiple items can be done with the Layout toolbar as suggested in previous reply. However you would have to proceed "row by row" and "column by column". If your goal is table like layout, you might consider using our table report item. More info is available here.
Regards,
Steve
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
The snapping is indeed turned on and as you can see the value in the InitializeComponent() is correct i.e. 1.6000000238418579. Since we're working with float, you cannot expect an integer value and even manually entered value of 1.6 would be represented as the float above.
Horizontal and vertical alignment of multiple items can be done with the Layout toolbar as suggested in previous reply. However you would have to proceed "row by row" and "column by column". If your goal is table like layout, you might consider using our table report item. More info is available here.
Regards,
Steve
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.