protected override void OnPreRender(EventArgs e) { try { //Hide controls on the page based on permission //Code to hide control // code to hide RadGrid AddNewRecordButton RadGrid1.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = false; } base.OnPreRender(e); } catch (Exception ex) { HandleException(ex, ErrorControl); } }Hi Team,
1) We are using RadGrid in our application, we plan to use the In-built functionality from Telerik Radgrid for Exporting the Grid data to Word document and PDF format document. We have Grid data, and Chart Image for the corresponding Grid Data which we displaying outside the Grid. I have attached the Screenshot of my application, I need to populate the Chart Image along with the Grid Data to word document and pdf document while export. (attached file Name: Application_ScreenShot.JPG)
2) Also I would like to know that Isn't it possible to export the Grid data with skin(font color,fort size,font family) to Word and Excel and PDF format.
3) While I tried to Export into PDF format, the Grid Data is not populating properly. Kindly find the attached file for get me.(attached File Name for reference: PDF.JPG)
Please give me any possible solution on this ASAP.
Thanks
Alexis
protected void Item_PreRender(object sender, EventArgs e) { string text = ((GridGroupHeaderItem)sender).DataCell.Text; for (int i = 4; i < ((GridGroupHeaderItem)sender).OwnerTableView.RenderColumns.Length; i++) { TableCell cell = new TableCell(); if (((GridGroupHeaderItem)sender).OwnerTableView.RenderColumns[i].UniqueName == "TESTDESC") { cell.Text = text.Trim().Replace(": ", ""); } if (((GridGroupHeaderItem)sender).OwnerTableView.RenderColumns[i].UniqueName == "Name") { cell.Text = "Name"; } if (((GridGroupHeaderItem)sender).OwnerTableView.RenderColumns[i].UniqueName == "ToTalScores") { cell.Text = "Total Scores"; } if (((GridGroupHeaderItem)sender).OwnerTableView.RenderColumns[i].UniqueName == "REPORTINGTIME") { cell.Text = "EST Time"; } if (((GridGroupHeaderItem)sender).OwnerTableView.RenderColumns[i].UniqueName == "MainGroupCollapse") { Button ExpandControl = ((GridGroupHeaderItem)sender).Cells[0].Controls[0] as Button; ExpandControl.CssClass = "rgCollapse"; cell.CssClass = "MainGroupCollapse"; cell.Controls.Add(ExpandControl); } if (((GridGroupHeaderItem)sender).OwnerTableView.RenderColumns[i].UniqueName == "DOWNLOAD") { LinkButton lnkDownloadBtn = new LinkButton(); lnkDownloadBtn.ID = "btnDownload"; lnkDownloadBtn.Text = "Download/Print"; lnkDownloadBtn.CommandName = "DownloadAndPrint"; lnkDownloadBtn.CssClass = "DownloadAndPrint"; cell.CssClass = "DownloadAndPrintCell"; cell.Controls.Add(lnkDownloadBtn); } if (((GridGroupHeaderItem)sender).OwnerTableView.RenderColumns[i].UniqueName == "LeftSide") { cell.CssClass = "LeftRightMargin"; } ((GridGroupHeaderItem)sender).Cells.Add(cell); } }protected void RadGridTest_ItemCommand(object source, GridCommandEventArgs e)
{ GridGroupHeaderItem Item2 = e.Item as GridGroupHeaderItem; if (Item2 is GridGroupHeaderItem) { if (e.CommandName.Equals("DownloadAndPrint")) { //call custom methods //RenderReport(TestDateTreeView.SelectedNode.Value, "Chem"); } }
}protected void btnPayment_Click(object sender, EventArgs e){ try { // do some stuff... // This code below opens the Save File Dialogue box .. String FilePath = Server.MapPath(".\\GiroPayments\\" + FileName + ""); System.Web.HttpResponse response = System.Web.HttpContext.Current.Response; response.ClearContent(); response.Clear(); response.ContentType = "text/plain"; response.AddHeader("Content-Disposition", "attachment; filename=" + FileName + ";"); response.TransmitFile(FilePath); response.Flush(); response.End(); rgGiroPayments.Rebind(); } catch() {}}<telerik:RadAjaxLoadingPanel ID="AjaxLoadingPanel1" runat="server" Height="75px" Width="75px">
<asp:Label runat="server" ID="lblTest" Text="appears here"/><br/>
<asp:Button runat="server" OnClick="btnTest_OnClick" ID="btnTest" Text="Test"/>
<telerik:RadAjaxManager runat="server" ID="AjaxManager1"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="btnTest"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="lblTest" LoadingPanelID="AjaxLoadingPanel1"/> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager>
and in the code behing
protected void btnTest_OnClick(object sender, EventArgs e) { lblTest.Text = "12324"; }
31|updatePanel|lblTestPanel|<span id="lblTest">12324</span>|53|updatePanel|AjaxManager1SU|<span id="AjaxManager1" style="display:none;"></span>
My site has the need to close a menu if the mouse leaves the window (its very close to the left edge, so its easily left open).
As we have multiple menu's on our page, there is the unlikely possibility that more tha none could be left open, so I really wanted to use a jQuery selector to find all menu controls, and fire its close() method when the mouse leaves the window.
I got to this :
$telerik.$(document).mouseleave(
function () {
$('.RadMenu').close();
}
);
However, the $('.RadMenu').close(); doesn't work - erroring that close() isn't supported. if I go through the results from $('.RadMenu'), they do seem to be the correct elements being returned (HTMLDiv objects).
Can anyone help?
Thanks,
Andrew