Start ripple animation from code

5 posts, 1 answers
  1. Patrick
    Patrick avatar
    38 posts
    Member since:
    Aug 2018

    Posted 01 Nov 2018 Link to this post

    Hello,

    I have a custom RadTileElement where the ripple animation is enabled.

    The animation works when clicking the tile element, but is it possible to raise/start the ripple animation from code?

    This to draw the attention of the user to the tile element.

    Grtz Patrick Vossen

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3401 posts

    Posted 02 Nov 2018 Link to this post

    Hello, Patrick, 

    The ripple animation is designed to be performed when you click an item with the mouse. However, you can simulate clicking with the mouse over a specific location on the tile element by using reflection: 

    public RadForm1()
    {
        InitializeComponent();
     
        this.radTileElement1.EnableRippleAnimation = true;
    }
     
    private void radButton1_Click(object sender, EventArgs e)
    {
        this.radTileElement1.EnableRippleAnimation = true;
        MethodInfo mi = typeof(RadItem).GetMethod("StartRippleAnimation", BindingFlags.Instance | BindingFlags.NonPublic);
        MouseEventArgs args = new MouseEventArgs(System.Windows.Forms.MouseButtons.Left, 1,
            this.radTileElement1.Location.X + this.radTileElement1.Size.Width / 2,
            this.radTileElement1.Location.Y + this.radTileElement1.Size.Height / 2,1);

    I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

     Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Patrick
    Patrick avatar
    38 posts
    Member since:
    Aug 2018

    Posted 02 Nov 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hi Dess,

     

    Thanks for your response.

    Is the code complete?

    If I read the code, only variables are created..

     

    Regards,

    Patrick Vossen

  4. Answer
    Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3401 posts

    Posted 05 Nov 2018 Link to this post

    Hello, Patrick, 

    If you refer to the provided code snippet in my previous post, you will notice that via reflection the StartRippleAnimation method is invoked. I have attached my sample project for your reference. It is just necessary to click the button.

    I hope this information helps.

     Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  5. Patrick
    Patrick avatar
    38 posts
    Member since:
    Aug 2018

    Posted 08 Nov 2018 Link to this post

    Hi Dess,

    Thanks for the answer and sample project.

    Ik works like a charm.

    Grtz Patrick

Back to Top