JavaScript to retrieve value from grid
<pre><code>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('&lt;%=TextBox1.ClientID%&gt;').value = str;");
    } 
}
</code></pre>

<p>I have called a <code>rowdatabound</code> event in which I am using a script like this. I get the error:</p>

<blockquote>
  <p>object element not found or not an object</p>
</blockquote>

<p>Please help me.</p>
