Hello
I am having radgrid.
I want to show a checkbox before each row.
I am having a delete button outside the grid.
Selected checkboxes rows should be deleted when user clicks on Delete button.
my primary key is LicenseId, by using this i want to delete the selected checkbox row.
Can you please continue my code to achieve the functionality?
aspx page:
CODE BEHIND :
i am getting error in the line, is there anyone other way to acheive this functionality??
sb.Append(row.OwnerTableView.DataKeyValues[row.RowIndex]["LicenseId"].ToString());
this is the error "array index outofbounds" in foreach i am getting only 4, but in the above line it is showing 8...
can anyone please help me out. thanks.,
I am having radgrid.
I want to show a checkbox before each row.
I am having a delete button outside the grid.
Selected checkboxes rows should be deleted when user clicks on Delete button.
my primary key is LicenseId, by using this i want to delete the selected checkbox row.
Can you please continue my code to achieve the functionality?
aspx page:
CODE BEHIND :
protected void btnDelete_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
bool flg = false;
foreach (GridDataItem row in Grid.MasterTableView.Items)
{
CheckBox cb = (CheckBox)row.FindControl("ChkDelete");
if (cb.Checked)
{
if (flg)
{
sb.Append(",");
}
else
{
flg = true;
}
sb.Append(row.OwnerTableView.DataKeyValues[row.RowIndex]["LicenseId"].ToString());
}
}
i am getting error in the line, is there anyone other way to acheive this functionality??
sb.Append(row.OwnerTableView.DataKeyValues[row.RowIndex]["LicenseId"].ToString());
this is the error "array index outofbounds" in foreach i am getting only 4, but in the above line it is showing 8...
can anyone please help me out. thanks.,