Hi,
With the help of the posts in http://www.telerik.com/community/forums/aspnet/grid/72051-radgrid-print.aspx#1532370 I could print the entire contents of radgrid in Internet Explorer and mozilla .But I am not able to print the radgrid of certain web pages of the application in same version of mozilla while able to do that in internet explorer.For those pages, the below function PrintRadGrid returns null for $find(radGridId).
For the non-working pages , if i put a alert as the first line of the function PrintRadGrid , then it is working
Could any body please explain why this happens and how to make it working ...
function getOuterHTML(obj) {
if (typeof (obj.outerHTML) == "undefined") {
var divWrapper = document.createElement("div");
var copyOb = obj.cloneNode(true);
divWrapper.appendChild(copyOb);
return divWrapper.innerHTML
}
else
return obj.outerHTML;
}
function PrintRadGrid(radGridId) {
var radGrid = $find(radGridId);
var previewWnd = window.open('about:blank', '', '', false);
var sh = '<%# ClientScript.GetWebResourceUrl(grdName.GetType(),String.Format("Telerik.Web.UI.Skins.{0}.Grid.{0}.css",grdName.Skin)) %>';
var styleStr = "<html><head><link href = '" + sh + "' rel='stylesheet' type='text/css'></link></head>";
var htmlcontent = styleStr + "<body>" + getOuterHTML(radGrid.get_element().parentNode) + "</body></html>";
previewWnd.document.open();
previewWnd.document.write(htmlcontent);
previewWnd.document.close();
previewWnd.print();
previewWnd.close();
radGrid.get_masterTableView().fireCommand("EnablePaging", "");
}
And in code behind
RadPnl.ResponseScripts.Add("PrintRadGrid('" + grdNmae.ClientID + "')");
Thanks
<
telerik:RadGrid
ID
=
"RadGridResources"
runat
=
"server"
Width
=
"950px"
ShowStatusBar
=
"true"
AutoGenerateColumns
=
"False"
PageSize
=
"7"
AllowSorting
=
"True"
AllowMultiRowSelection
=
"True"
AllowPaging
=
"True"
>
<
PagerStyle
Mode
=
"NumericPages"
></
PagerStyle
>
<
MasterTableView
Width
=
"100%"
DataKeyNames
=
"IDResource"
AllowMultiColumnSorting
=
"True"
HierarchyDefaultExpanded
=
"true"
>
<
DetailTables
>
<
telerik:GridTableView
DataKeyNames
=
"IDSlot"
Name
=
"Slot"
Width
=
"100%"
>
<
Columns
>
<
telerik:GridClientSelectColumn
HeaderStyle-Width
=
"40px"
UniqueName
=
"CheckboxSelectIDSlotColumn"
>
<
HeaderStyle
Width
=
"40px"
/>
</
telerik:GridClientSelectColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"IDSlot"
HeaderText
=
"IDSlot"
HeaderButtonType
=
"TextButton"
DataField
=
"IDSlot"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"Code"
HeaderText
=
"Code"
HeaderButtonType
=
"TextButton"
DataField
=
"Code"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"Description"
HeaderText
=
"Description"
HeaderButtonType
=
"TextButton"
DataField
=
"Description"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
telerik:GridTableView
>
</
DetailTables
>
<
Columns
>
<
telerik:GridBoundColumn
SortExpression
=
"IDResource"
HeaderText
=
"IDResource"
HeaderButtonType
=
"TextButton"
DataField
=
"IDResource"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"Code"
HeaderText
=
"Code"
HeaderButtonType
=
"TextButton"
DataField
=
"Code"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"Description"
HeaderText
=
"Description"
HeaderButtonType
=
"TextButton"
DataField
=
"Description"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
enablePostBackOnRowClick
=
"true"
>
<
ClientEvents
/>
<
Selecting
AllowRowSelect
=
"true"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
Protected Sub RadGridResources_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGridResources.SelectedIndexChanged
Try
Dim selectedItems As New ArrayList
Dim idSlot As Long
For i = 0 To RadGridResources.SelectedItems.Count - 1
Dim dataItem As GridDataItem = RadGridResources.SelectedItems(i)
idSlot = dataItem("IDSlot").Text
selectedItems.Add(idSlot)
Next
'TO DO
Catch ex As Exception
End Try
End Sub
I have a RadMenu in a SharePoint master page. The problem is, when I select the site Actions dropdown it appears behind the RadMenu. The Default z-index of the menu is 7000, I’ve set it to (z-index 3 !important) with no change to the issue.
How should I configure the RadMenu to appear below the SharePoint Site Actions Menu, But will still remain above the other Telerik controls.
GridGroupHeaderItem groupHeader = dtgLeads.MasterTableView.GetItems(GridItemType.GroupHeader)[index] as GridGroupHeaderItem;
GridItem[] children = groupHeader.GetChildItems();
bool hasChild = groupHeader.HasChildItems;
children.Count() > 0
flag = true;
foreach (GridItem child in children)
{}
// this is wired up to a ASP:BUTTON -- onClick event
function upDatePAMLabel(label,grid) {
$("#" + label).html("There are no User IDs waiting to be exported");
// AJAX Call back here to refresh the grid
// $("#" + grid).ajax("PortalAdminManager.aspx", "", "rgRequests_NeedDataSource","");
/* does nothing!
$.ajax({
type: "POST",
url: "PortalAdminManager.aspx/rgRequests_NeedDataSource",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
alert(msg)
}
});
*/
// brute force method - to refresh the grid
//
force a reload so that Request Status is updated in the grid
$(document).ready(function () {
setTimeout(function () { window.location.href = "./PortalAdminManager.aspx"; }, 1000);
});
}