modal window through datagrid hyperlink
-
Hi, my problem is I want to open a aspx page in modal window, when user clicks on datagrid's hyperlink column. I'm creating datagrid and its columns at run time, so I can not write binding command in html. Problem is, how I can pass reference of bounded column in place of parameter. This is the code: _DataGrid1.DataNavigateUrlFormatString = String.Format("javascript:window.showModalDialog(""NewPage.aspx?LicID={0}"")", "parameter") Thanks in advance. Neeraj
-
Hi, my problem is I want to open a aspx page in modal window, when user clicks on datagrid's hyperlink column. I'm creating datagrid and its columns at run time, so I can not write binding command in html. Problem is, how I can pass reference of bounded column in place of parameter. This is the code: _DataGrid1.DataNavigateUrlFormatString = String.Format("javascript:window.showModalDialog(""NewPage.aspx?LicID={0}"")", "parameter") Thanks in advance. Neeraj
-
At runtime, you can dynamically build the hyperlink column like this:
HyperLinkColumn col = new HyperLinkColumn();
col.DataNavigateUrlField = "LicID";
col.DataNavigateUrlFormatString = "javascript:window.showModalDialog('NewPage.aspx?LicID={0}')";Thanks for reply, but it takes "{0}" as parameter of ShowModalDialog. Neeraj
-
Thanks for reply, but it takes "{0}" as parameter of ShowModalDialog. Neeraj
Do you specify the data field in the
DataNavigateUrlField
property of the HyperLink column? At data binding time, the data of the specified field is populated, then it is formatted using the format string. So you should not see the {0} which is supposed to be replaced by the value of the field bound to the row. -
Do you specify the data field in the
DataNavigateUrlField
property of the HyperLink column? At data binding time, the data of the specified field is populated, then it is formatted using the format string. So you should not see the {0} which is supposed to be replaced by the value of the field bound to the row.Thanks, It is done. Now I'm passing {0} in parameter also which in turn picks the datafield. Neeraj