This example demonstrates how to create a column's template, add a hyperlink to that template, and show a pop-up window with detail grid data on a hyperlink click.
Call a column's SetDataItemTemplateContent method and add a hyperlink control to the template. Handle the hyperlink's Click
event. In the handler, specify the URL to the page with detail data, pass the URL as a parameter to the popup control's SetContentUrl method, and invoke a pop-up window.
settings.Columns.Add(col => {
col.FieldName = "CustomerID";
col.SetDataItemTemplateContent(container => {
Html.DevExpress().HyperLink(hlSettings => {
hlSettings.Name = string.Format("hl_{0}", (container as GridViewDataItemTemplateContainer).VisibleIndex);
hlSettings.NavigateUrl = "javascript:void(0)";
hlSettings.Properties.ClientSideEvents.Click = string.Format("function(s, e) {{ ShowDetailPopup('{0}'); }}", Url.Action("DetailAction", "Home", new { _customerID = (container as GridViewDataItemTemplateContainer).KeyValue.ToString() }));
hlSettings.Properties.Text = "Show Orders";
}).Render();
});
});
function ShowDetailPopup(url) {
popup.SetContentUrl(url);
popup.Show()
}
(you will be redirected to DevExpress.com to submit your response)