title: How do I run the RowDataBound method in the onClick method below?
body: <p>I have a GridView as follow</p>
  
  <pre><code>`&lt;asp:GridView ID="gvSearchAll" runat="server" AutoGenerateColumns="False"
       OnPageIndexChanging="searchAll_PageIndexChanging" 
       onrowdatabound="OnRowDataBound"&gt;
           &lt;Columns&gt;
                &lt;asp:BoundField DataField="A" HeaderText="A"/&gt;
                &lt;asp:BoundField DataField="B" HeaderText="B"/&gt;
                &lt;asp:BoundField DataField="C" HeaderText="C" /&gt;
                &lt;asp:TemplateField HeaderText="Select"&gt;
                    &lt;ItemTemplate&gt;
                       &lt;asp:CheckBox ID="RowSelector" runat="server" onclick="checkRadioBtn(this);" /&gt;
                    &lt;/ItemTemplate&gt;
                &lt;/asp:TemplateField&gt;                  
           &lt;/Columns&gt;          
   &lt;/asp:GridView&gt;`
  </code></pre>
  
  <p>OnRowDataBound on CodeBehind, I have the following:</p>
  
  <pre><code>protected void OnRowDataBound(object sender, GridViewRowEventArgs e)
      {
          if (e.Row.RowType == DataControlRowType.DataRow)
          {               
             e.Row.Cells[3].Attributes.Add("onclick", string.Format("DisplayDetails('{0}');", e.Row.RowIndex + 1));
             e.Row.Attributes["onmouseover"] = "onMouseOver('" + (e.Row.RowIndex + 1) + "')";
             e.Row.Attributes["onmouseout"] = "onMouseOut('" + (e.Row.RowIndex + 1) + "')";
          }        
  
      }
  </code></pre>
  
  <p>Now what I wanted actually, was the DisplayDetails function to be run when the checkbox is clicked.</p>
  
  <pre><code> function DisplayDetails(row) {
      var gridView = document.getElementById('gvSearchAll');  
      document.getElementById("A").value = gridView.rows[row].cells[1].innerText;
      document.getElementById("B").value = gridView.rows[row].cells[0].innerText;      
  }
  </code></pre>
  
  <p>What I wanted to do was, when the checkbox is clicked, I want to fill the particular checkbox's row's A and B column Data to some Text Field.</p>
  
  <p>The onClick function, checkRadioBtn(this), does something else.</p>
  
  <p>Now, Currently, I am executing the Display Details function whenever I click the entire cell of the CheckBox.
  What I need, is to execute the DisplayDetails function, in the checkRadioBtn(this) function, but for that I need something like, (this.row_index), which I am unable to figure out how to do.</p>
  
  <p>Please help.</p>