<asp:GridView ID="GridView1" runat="server" style="width: 615px; margin: 30px;" class="table table-hover table-bordered" AutoGenerateSelectButton="true" OnSelectedIndexChanging="GridView1_SelectedIndex2"></asp:GridView>
protected void GridView1_SelectedIndex2(object sender, GridViewSelectEventArgs e)
{
txtLastName.Text = GridView1.Rows[e.NewSelectedIndex].Cells[3].Text;
txtFirstName.Text = GridView1.Rows[e.NewSelectedIndex].Cells[2].Text;
}
Based on above code, I generate data in the GridView
, and supposedly, when I clicked one of the rows
in GridView
, the data will be displayed in each textbox
based on the cells
in each rows
.
From what I looked up from the sources, I found the codes that use select button only. and I want to display data without select button.
So, somebody can help me?