tags:

views:

37

answers:

1
protected void GridLedger_RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.DataRow) 
    {
        e.Row.Attributes.Add("onMouseDown", "var str = document.getElementById('" + e.Row.ClientID + "').cells[0].innerText; document.getElementById('<%=TextBox1.ClientID%>').value = str;");
    } 
}

hai friends

i have called an rowdatabound event in that i am using a script like this.error is raising like object element not found or not an object.pls help me with solution

A: 

I would recommend you to use the jQuery library or any other javascript framework to make your life a LOT easier.

This errors seems to me that you either can't find the object you are looking for or the property cells does not exist. This might even differ from browser to browser ...

Have a look at your generated code and see what the ID of that error is ...

afgallo