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

radChart position and size?

2 Answers 118 Views
Chart (obsolete as of Q1 2013)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jim Miles
Top achievements
Rank 1
Jim Miles asked on 22 Oct 2008, 07:08 PM
Hi,

I've been using the asp.net controls for years with great success and now trying to use the winForm controls.  But have hit a snag that should be simple and I must be missing something.

I originally posted a more complex message about setting the size and location of a programatically created radChart.  I found the height/width settings so can now change the size.  Now just need to figure out how to set the location to anchor the chart at to a specific coordinate on the form (like at 4, 44).  All the properties that are intuitive are read-only.

Such as position.x & y, location.x & y, etc..

None of the sample code seems to set the location of the chart.  Placing a chart on the form is easy enough, but that causes other problems with updating and combining chart types.

Any pointers are appreciated.

-jim


2 Answers, 1 is accepted

Sort by
0
Dwight
Telerik team
answered on 24 Oct 2008, 07:44 AM
Hello Jim,

The trick here is that the property Location is of type Point, which is a struct. By Microsoft's convention, structs should be immutable, i.e. if a change in a struct is required, new instance should be created.

So, instead of:
this.radChart1.Location.X = 20; 

You should use:
this.radChart1.Location = new Point(50, 10); 

Regards,
Evtim
0
Jim Miles
Top achievements
Rank 1
answered on 24 Oct 2008, 12:50 PM
Thanks Evtim!

I knew I was missing something simple...  the autofill doesn't really indicate that it's a point.  But now I know for all controls!

-jim
Tags
Chart (obsolete as of Q1 2013)
Asked by
Jim Miles
Top achievements
Rank 1
Answers by
Dwight
Telerik team
Jim Miles
Top achievements
Rank 1
Share this question
or