Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have checkbox in gridview for delete a selectin item, and on asp.net I have to to get the 3 index value of check box

I have checkbox in gridview for delete a selectin item, and on asp.net I have to to get the 3 index value of check box which separated by (,) and each row separated by (|), if user select the check box once and click on the delete key I does delete the selected row which fine, but if user check and uncheck a same row, must not to delete a row, but it does still delete it if check and uncheck before click on the delete key. Can u help me for my code please?

Asp. Net code:                         protected void btnDelete_Click(object sender, EventArgs e) { string[] Checked = hfLegalRecords.Value.Split('|'); for (int i = 0; i < Checked.Length - 1; ++i) { Boolean checkSelect = false; string[] value = Checked[i].Split(','); string checkbox = value[0]; string ClientCode = value[1]; string DebtorNumber = value[2]; for (int j = 0; j < Checked.Length - 1; ++j) { string[] valueS = Checked[j].Split(','); string checkboxS = valueS[0]; string ClientCodeS = valueS[1]; string DebtorNumberS = valueS[2]; if (ClientCode == ClientCodeS && DebtorNumber == DebtorNumberS) checkSelect = true; } if (checkSelect == true) LegalEvents.RemoveSelectCheckBox(ClientCode, DebtorNumber); } LoadLegalRecords(); } 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started