I have a few questions when it comes to adding a CheckBox column to a gridview in asp.net and getting multiple values. Firstly, I see that everyone added OnCheckedChanged="chkview_CheckedChanged" to their aspx page, but when you click on CheckBox to set its actions, it does not open OnCheckedChanged="chkview_CheckedChanged" . Instead, it fires the SelectedIndexChanged event. I try to do when they select CheckBox , it adds information about the corresponding lines to the TextBox . Here is what I am using to set the values. How can I use the selected CheckBox instead?
protected void dropGridView_SelectedIndexChanged1(object sender, EventArgs e) { GridViewRow row = dropdeadGridView.SelectedRow; IDTextBox.Text = row.Cells[1].Text; loadnumTextBox.Text = row.Cells[2].Text; }
Once you are done with this, how can you do it where it will receive each checked line, and not just one, which is my current problem. I am looking for a way to select multiple rows and select a select button. I searched a lot and can't find anything, so I'm trying to accomplish this with CheckBoxes . Any ideas how I can add this and get a few lines that I can select. Thank you in advance.
Here is my edit * Posting ASP code for a CheckBox column:
<asp:TemplateField> <ItemTemplate> <asp:CheckBox ID="SelectCheckBox" runat="server" OnCheckedChanged="SelectCheckBox_OnCheckedChanged"/> </ItemTemplate> </asp:TemplateField>
source share