Thought I'd share what I did to turn the product name into a link from Categories page. The following will turn Product Name into a link within the products list, opening a new popup modal window on top of the current pop modal window and when closed the categories' product list will still be there.
/{folder for your admin section}/controls/EntityProductmap.aspx -
Comment out the label
Code:
<asp:Label ID="lblName" runat="server" Text='<%# ML_Localize(DataItemAs<AspDotNetStorefrontAdmin.Controls.ProductEntityMapInfo>(Container).Name) %>'></asp:Label>
Add a linkbutton below the commented out label:
Code:
<asp:LinkButton ID="lnkName" runat="server" Text='<%# ML_Localize(DataItemAs<AspDotNetStorefrontAdmin.Controls.ProductEntityMapInfo>(Container).Name) %>'></asp:LinkButton>
/{folder for your admin section}/controls/EntityProductmap.aspx.cs -
In the Using Directives section, at the top of the code page add
Within the function protected override void OnInit(EventArgs e) add:
Code:
// copied from the ProductsGrid.ascx with some mods to the js to popup a new
// start of add
window from a popup window
string gridID = ctrlSearch.FindControl("grdMap").ClientID;
StringBuilder sb = new StringBuilder();
#region RadWindow Javascript Functions
sb.Append("<script type=\"text/javascript\"> \r\n");
sb.Append("function GetRadWindow() \r\n");
sb.Append("{ \r\n");
sb.Append(" var oWindow = null; if (window.radWindow) \r\n");
sb.Append(" oWindow = window.radWindow; else if (window.frameElement.radWindow) \r\n");
sb.Append(" oWindow = window.frameElement.radWindow; return oWindow; \r\n");
sb.Append("} \r\n");
/*Instantiates a new modal window with the Edit Product page in edit mode*/
sb.Append("function ShowEditForm(id, rowIndex) \r\n");
sb.Append("{ \r\n");
sb.Append(" var grid = $find(\"" + gridID + "\"); \r\n");
sb.Append(" \r\n");
sb.Append(" var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element(); \r\n");
sb.Append(" grid.get_masterTableView().selectItem(rowControl, true); \r\n");
sb.Append(" \r\n");
sb.Append(" var oBrowserWnd = GetRadWindow().BrowserWindow; \r\n");
sb.Append(" oBrowserWnd.radopen(\"entityEditProducts.aspx?iden=\" + id + \"&entityName=CATEGORY\", \"rdwEditProduct\"); \r\n");
sb.Append(" return false; \r\n");
sb.Append("} \r\n");
sb.Append("</script> \r\n");
#endregion
ClientScriptManager cs = Page.ClientScript;
cs.RegisterClientScriptBlock(this.Page.GetType(), Guid.NewGuid().ToString(), sb.ToString());
// end of add
Within the function protected void grdMap_ItemCreated(Object sender, GridItemEventArgs e) add the follow code right below ProductEntityMapInfo productMapInfo in code:
Code:
ProductEntityMapInfo productMapInfo = e.Item.DataItem as ProductEntityMapInfo;
if (productMapInfo == null)
return;
// start of add
var lnkName = e.Item.FindControl<LinkButton>("lnkName");
if (lnkName != null)
{
lnkName.Attributes["src"] = "#";
lnkName.Attributes["onClick"] = String.Format("return ShowEditForm('{0}','{1}');", productMapInfo.ProductId.ToString(), e.Item.ItemIndex);
lnkName.Attributes["style"] = "cursor:pointer;";
}
//end of add
Should end up with this: