Has anyone found the best way, when using a radgrid, to have the "add new record" page popup in a lightbox type screen overlay? Perhaps the asp popupmodal?
I found a tutorial that is dead on, but way outdated here: here
Ok, so after working all day on getting the window popup to work when the user clicks the edit/double click/add new record, I ran into another problem. I can't seem to get the ID from the dataitem of the e argument.
So here's the code (from the tutorial above. The tutorial works, but not my project)
When I use the path e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["jobID"] there is nothing there. I can see that the jobID is
at the path e.Item.DataItem, all the columns are listed there, but I can't access them. e.Item.DataItem.jobID doesn't work like I think it should. The only thing is I am using a sql database, and the tutorial is using access. That must be the difference. I changed the access database in their tutorial, and it doesn't work.
I found a tutorial that is dead on, but way outdated here: here
Ok, so after working all day on getting the window popup to work when the user clicks the edit/double click/add new record, I ran into another problem. I can't seem to get the ID from the dataitem of the e argument.
So here's the code (from the tutorial above. The tutorial works, but not my project)
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
HyperLink editLink = (HyperLink)e.Item.FindControl("EditLink");
editLink.Attributes["href"] = "#";
editLink.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["jobID"], e.Item.ItemIndex);
}
}
When I use the path e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["jobID"] there is nothing there. I can see that the jobID is
at the path e.Item.DataItem, all the columns are listed there, but I can't access them. e.Item.DataItem.jobID doesn't work like I think it should. The only thing is I am using a sql database, and the tutorial is using access. That must be the difference. I changed the access database in their tutorial, and it doesn't work.