locked
Rotating a graphic/grouping using a button RRS feed

  • Question

  • Greetings All,

     

    Hopefully an easy question ... I have a 'DataGrid' and a 'Button' control, when I press the button I want the DataGrid to rotate by a certain value (defined in C# code) e.g.

    private void RotateByXDegButton (object sender, System.Windows.RoutedEventArgs e)
    {MyDatagrid.RenderTransform.Value.Rotate = 50;}

    ... is this correct? (because I can't get it to work)

     

    Many Thanks in advance,

    Regards,

    -RJ-

    (Using Blend3, WPF)

    Wednesday, May 26, 2010 11:54 AM

Answers

  • Assign a new rendertransform to the property, like this:

    this.MyDataGrid.RenderTransform = new RotateTransform(45);

     

     

    • Proposed as answer by Chuck HaysModerator Wednesday, May 26, 2010 12:34 PM
    • Marked as answer by dt01rrj Wednesday, May 26, 2010 12:37 PM
    Wednesday, May 26, 2010 12:34 PM
    Moderator

All replies

  • Assign a new rendertransform to the property, like this:

    this.MyDataGrid.RenderTransform = new RotateTransform(45);

     

     

    • Proposed as answer by Chuck HaysModerator Wednesday, May 26, 2010 12:34 PM
    • Marked as answer by dt01rrj Wednesday, May 26, 2010 12:37 PM
    Wednesday, May 26, 2010 12:34 PM
    Moderator
  • Genius !

    Many thanks Mr Hays.

     

    Cheers,

    -RJ-

    Wednesday, May 26, 2010 12:39 PM