radChart position and size?

3 posts, 0 answers
  1. Jim Miles
    Jim Miles avatar
    22 posts
    Member since:
    May 2006

    Posted 22 Oct 2008 Link to this post

    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. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 24 Oct 2008 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Jim Miles
    Jim Miles avatar
    22 posts
    Member since:
    May 2006

    Posted 24 Oct 2008 Link to this post

    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
Back to Top