Hi guy,
I have a little problem. I'm using a hierarchy grid. The "parent" grid show the roles in my table aspnet_Roles. The nested grid show the user related to the role. For populating my grid, I'm using a dataSet. My problem is that I don't know how to delete the relation between a user and a role using a context menu. I tried the seconde example on this page, but I still have some problems. In fact, this is how I do :
When I tried it, this message appears : Cannot find a cell bound to column name 'RoleName'
The only way I find to correct this problem is to add the column RoleName to the nested grid, but I don't really like showing the name of the role for each user. So, is it possible to find to which row the nested grid is related and access his data (in my case, RoleName).
Thank you,
David Lefaivre-B.
I have a little problem. I'm using a hierarchy grid. The "parent" grid show the roles in my table aspnet_Roles. The nested grid show the user related to the role. For populating my grid, I'm using a dataSet. My problem is that I don't know how to delete the relation between a user and a role using a context menu. I tried the seconde example on this page, but I still have some problems. In fact, this is how I do :
string[] args = Request.Form["radGridClickedRowIndex"].Split('_');
int indice = Convert.ToInt32(args[args.Length - 1]);
string UId = Request.Form["radGridClickedTableId"];
GridTableView tableView;
tableView = this.Page.FindControl(UId) as GridTableView;
string userName = ((tableView as GridTableView).Items[indice] as GridDataItem)["UserName"].Text;
string roleName = ((tableView as GridTableView).Items[indice] as GridDataItem)["RoleName"].Text;
Roles.RemoveUserFromRole(userName, roleName);
tableView.Rebind();
When I tried it, this message appears : Cannot find a cell bound to column name 'RoleName'
The only way I find to correct this problem is to add the column RoleName to the nested grid, but I don't really like showing the name of the role for each user. So, is it possible to find to which row the nested grid is related and access his data (in my case, RoleName).
Thank you,
David Lefaivre-B.