RowDataBound GridView UpdatePanel woes

Last post 06-19-2007 11:06 AM by kylegohn. 1 replies.

Sort Posts:

  • RowDataBound GridView UpdatePanel woes

    05-24-2007, 7:11 PM
    • Loading...
    • kylegohn
    • Joined on 05-18-2007, 2:37 PM
    • Posts 3

     Okay, I am a newbie to this realm .net controls, so please be kind...

    I have a page that contains a tabcontainer, inside one of the tab panels I have an update panel - and inside that i have a sortable gridview. I am trying to make the row on the gridview clickable but can't seem to catch the rowdatabound event of my GridView1. I need to trap the rowdatabound event so I can add the following code.

     
            protected void GridView1_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
            {
                if ((e.Row.RowType == DataControlRowType.DataRow))
                {
                    e.Row.Attributes["style"] += "cursor: pointer; cursor: hand;";
                    e.Row.Attributes["ondblclick"] = Page.ClientScript.GetPostBackEventReference(Select, String.Empty);
                }
            }
     
    The overall outcome, is that I want the user to be able to select a row on the gridview which will push them to the next tab that would contain all of the relevant information from the parent record selected.

    Unfortunately I can't even seem to get my hidden ButtonField to fire accordingly. Any Help would be terrific!
    Thanks In Advance.

  • Re: RowDataBound GridView UpdatePanel woes

    06-19-2007, 11:06 AM
    Answer
    • Loading...
    • kylegohn
    • Joined on 05-18-2007, 2:37 PM
    • Posts 3

    Trying to bite off more than I can chew. Turns out that my control wasn't firing because in C# one must reference the event code in the object itself. Code up above works great and allows me to modify the gridview accordingly.

     

Page 1 of 1 (2 items)
Microsoft Communities
Page view counter