animate gridview row

Last post 09-09-2009 10:44 AM by rtpHarry. 1 replies.

Sort Posts:

  • animate gridview row

    09-09-2009, 10:10 AM
    • Member
      128 point Member
    • neilhanvey
    • Member since 03-28-2007, 3:05 PM
    • Posts 92

    ok i've seen this asked in lots of places and everything points towards http://scottrk.wordpress.com/2007/11/08/animate-a-gridview-row-using-the-ajax-control-toolkit-from-client-code/

    my problem is that i've no idea to implement this as the instructions on this link are a bit flaky

    here's the code, anyone know how to implement this without using a regular htmlbutton (like in the code)

    my other main problem is that i can't figure out what's javascript and what's csharp :) (i'm one of thos vb people)

    function animateRow(affectedRow)
    {
        //first save the existing row color so you can restore it after the animation is completed
        //you may have to do some post-processing to make sure the affectedRowColor is a hex value like #FFFFFF
        var affectedRowColor = affectedRow.style.backgroundColor;
        animation = new AjaxControlToolkit.Animation.ColorAnimation(affectedRow, 2, 32, “style”, “backgroundColor”, “#ffff99″, affectedRowColor);
        animation.play();
    }

    protected void gv_RowCreated(object sender, GridViewRowEventArgs e)
        {
            GridView gview = (GridView)sender;
            e.Row.Attributes.Add(”id”, gview.DataKeys[e.Row.RowIndex]["id"].ToString());
        }


    var id = “idhere”;
    var affectedRow = $get(id);

    animateRow(affectedRow);


  • Re: animate gridview row

    09-09-2009, 10:44 AM
    Answer
    • All-Star
      36,254 point All-Star
    • rtpHarry
    • Member since 10-01-2006, 8:51 AM
    • Lincoln, England
    • Posts 5,835

    Hey,

    animateRow() is a javascript method, you should put it in a script tag in your <head> element of the page you want to use it on.


    RowCreated is c# code.


    The last bit is javascript.


    You are correct that the tutorial is not very clear. I dont have enough time to try and unwravell this at the moment but I will try to remember to check this thread this evening and see if ur still having problems.

Page 1 of 1 (2 items)