Hi guys. I just started to use Telerik control.
I have a RadGrid, when users click on the hyperlink, it will pop up and show the user list. I had it running smoothly with a form that using <asp:Content> with a master page. But I have to create another page that without the master page, so I only use normal <html> tag but the radopen is not showing the pop up. Please help.
CS Code
protected void gvHistory_ItemDataBound(object sender, GridItemEventArgs e)
{
GridDataItem item = (GridDataItem)e.Item;
HyperLink hlink = (HyperLink)e.Item.FindControl("hlink");
hlink.Attributes.Add("Onclick", " return radopen('frmViewUser.aspx?Role_ID=" + item["ROLE_ID"].Text + "','RadWindow1');");
}
ASPX
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<script type="text/javascript">
function printWindow() {
bV = parseInt(navigator.appVersion)
if (bV >= 4) window.print()
}
function GridCreated(sender, args) {
var scrollArea = sender.GridDataDiv;
var dataHeight = sender.get_masterTableView().get_element().clientHeight;
if (dataHeight < 250) {
scrollArea.style.height = dataHeight + 17 + "px";
}
}
</script>
<style type="text/css">
.RadWindow {top: 0px!important; left: 0px!important;}
</style>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<table>
<tr>
<td>
<telerik:RadGrid ID="gvHistory" runat="server" AutoGenerateColumns="False" Width="100%" ExportSettings-Pdf-AllowPrinting="true"
PagerStyle-AlwaysVisible="false" CellSpacing="0" ShowFooter="False" Skin="Windows7" TableLayout="Auto"
Font-Size="10px" GridLines="None" EnableLinqExpressions="False" OnItemDataBound="gvHistory_ItemDataBound">
<MasterTableView EnableNoRecordsTemplate="true" DataKeyNames="ID" ItemStyle-Wrap="True" HeaderStyle-Wrap="False"
Width="100%">
<Columns>
<telerik:GridBoundColumn DataField="DESCRIPTION" HeaderText="ICMS Status" HeaderTooltip="ICMS Status" UniqueName="DESCRIPTION">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Approver" DataField="ROLE_NAME"
AllowFiltering="false">
<ItemTemplate>
<asp:HyperLink ID="hlink" runat="server" Text='<%# Eval("ROLE_NAME") %>'
Onclick="radopen('frmViewRoleUserform.aspx?Role_ID=" + '<%# Eval("ROLE_NAME") %>' + "','RadWindow1')"></asp:HyperLink>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="USER_NAME" HeaderText="Approved By" HeaderTooltip="Approved By">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ACTION_TIME" HeaderText="Date" HeaderTooltip="Date" UniqueName="ACTION_TIME">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="COMMENTS" HeaderText="Comment" HeaderTooltip="Comment">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ROLE_ID" Display ="false" UniqueName="ROLE_ID">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<ClientSettings>
<Scrolling AllowScroll="False" SaveScrollPosition="True" />
<ClientEvents OnGridCreated="GridCreated" />
</ClientSettings>
<PagerStyle Mode="NextPrevNumericAndAdvanced" />
</telerik:RadGrid>
</td>
</tr>
</table>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
<Windows>
<telerik:RadWindow ID="RadWindow1" runat="server" ShowContentDuringLoad="false" Width="800px"
Height="400px" Title="Role Users" Behaviors="Default" Left ="10" Top="10" >
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
</asp:Panel>
<br />
</div>
</form>
</body>
</html>
I have a RadGrid, when users click on the hyperlink, it will pop up and show the user list. I had it running smoothly with a form that using <asp:Content> with a master page. But I have to create another page that without the master page, so I only use normal <html> tag but the radopen is not showing the pop up. Please help.
CS Code
protected void gvHistory_ItemDataBound(object sender, GridItemEventArgs e)
{
GridDataItem item = (GridDataItem)e.Item;
HyperLink hlink = (HyperLink)e.Item.FindControl("hlink");
hlink.Attributes.Add("Onclick", " return radopen('frmViewUser.aspx?Role_ID=" + item["ROLE_ID"].Text + "','RadWindow1');");
}
ASPX
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<script type="text/javascript">
function printWindow() {
bV = parseInt(navigator.appVersion)
if (bV >= 4) window.print()
}
function GridCreated(sender, args) {
var scrollArea = sender.GridDataDiv;
var dataHeight = sender.get_masterTableView().get_element().clientHeight;
if (dataHeight < 250) {
scrollArea.style.height = dataHeight + 17 + "px";
}
}
</script>
<style type="text/css">
.RadWindow {top: 0px!important; left: 0px!important;}
</style>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<table>
<tr>
<td>
<telerik:RadGrid ID="gvHistory" runat="server" AutoGenerateColumns="False" Width="100%" ExportSettings-Pdf-AllowPrinting="true"
PagerStyle-AlwaysVisible="false" CellSpacing="0" ShowFooter="False" Skin="Windows7" TableLayout="Auto"
Font-Size="10px" GridLines="None" EnableLinqExpressions="False" OnItemDataBound="gvHistory_ItemDataBound">
<MasterTableView EnableNoRecordsTemplate="true" DataKeyNames="ID" ItemStyle-Wrap="True" HeaderStyle-Wrap="False"
Width="100%">
<Columns>
<telerik:GridBoundColumn DataField="DESCRIPTION" HeaderText="ICMS Status" HeaderTooltip="ICMS Status" UniqueName="DESCRIPTION">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Approver" DataField="ROLE_NAME"
AllowFiltering="false">
<ItemTemplate>
<asp:HyperLink ID="hlink" runat="server" Text='<%# Eval("ROLE_NAME") %>'
Onclick="radopen('frmViewRoleUserform.aspx?Role_ID=" + '<%# Eval("ROLE_NAME") %>' + "','RadWindow1')"></asp:HyperLink>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="USER_NAME" HeaderText="Approved By" HeaderTooltip="Approved By">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ACTION_TIME" HeaderText="Date" HeaderTooltip="Date" UniqueName="ACTION_TIME">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="COMMENTS" HeaderText="Comment" HeaderTooltip="Comment">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ROLE_ID" Display ="false" UniqueName="ROLE_ID">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<ClientSettings>
<Scrolling AllowScroll="False" SaveScrollPosition="True" />
<ClientEvents OnGridCreated="GridCreated" />
</ClientSettings>
<PagerStyle Mode="NextPrevNumericAndAdvanced" />
</telerik:RadGrid>
</td>
</tr>
</table>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
<Windows>
<telerik:RadWindow ID="RadWindow1" runat="server" ShowContentDuringLoad="false" Width="800px"
Height="400px" Title="Role Users" Behaviors="Default" Left ="10" Top="10" >
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
</asp:Panel>
<br />
</div>
</form>
</body>
</html>