Here is the scenario I am presented with.
- RadGrid with 100 rows and a checkbox column for selecting rows.
- RadGrid takes 30 seconds to load.
- Issue is with the intial load and the database and we are not allowed to modfiy the data so we have to work with it.
- Above the RadGrid is a dropdownlist to assign another User to a product.
- The RadGrid has a column for User.
- When selecting another User from the dropdownlist I would like the checked rows in the grid to change the User in the grid to the one selected in the Dropdownlist WITHOUT rebinding the grid from the database and updating the selected rows with the dropdownlist value.
Could I do it in the Button_Click by just changing the row in the grid by modifying the selected rows that are held in View State? If so, HELP please.
This is my Code behind from the Grid
protected void ButtonAssign_Click(object sender, EventArgs e) |
{ |
foreach (GridDataItem item in RadGrid1.MasterTableView.Items) |
{ |
CheckBox chkbx = (CheckBox)item["ClientSelectColumn"].Controls[0]; |
if (chkbx.Checked) |
{ |
ProductBLL myData = new ProductBLL(); |
string productId = item["ID"].Text.ToString(); |
string user = Convert.ToString(DropDownListUserNew.SelectedValue); |
myData.ProductId = Convert.ToInt32(productId ); |
myData.User = user ; |
myData.UpdateUser(); |
I would like to update the ViewState so the RadGrid Column and Row have the new user |
} |
} |
} |
Thank you!