Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
1.6K+ views

Hello!

After downloading a file from a grid, my page keeps loading in loop, never stoppin. In order to be abble to do the download,

Along the way, i found out that the following function to disable AJAX was necessary to allow postback, so i believe the issue comes from here.


 function onRequestStart(sender, args) {
                           try {
                               if (args.get_eventTarget().indexOf("lnkDownload") >= 0) {
                                   args.set_enableAjax(false);
                                   return true;
                               }
                           }
                           catch (ex) {
                               alert("Error pushing postback: " + ex.message);
                           }
                       }

I also tried a similar function,, seting timeout in order to try to reestablish the normal behavour of the page, with any success.

function gridCommand(sender, args) {
                           if (args.get_commandName() == "download_file") { // "DownloadAttachment"
                               manager.set_enableAJAX(false);

                               setTimeout(function () {
                                   manager.set_enableAJAX(true);
                               }, 0);
                           }
                       } 

Any ideas on the solution for this problem?

Harlem98
Top achievements
Rank 1
Iron
Iron
Iron
 asked on 09 Nov 2021
1 answer
286 views

Hi, 

I am using a RadPdfViewer control and i have a PDF with forms fiels but, when render the pdf file, Form fields don't appear.

Vessy
Telerik team
 answered on 08 Nov 2021
1 answer
540 views

who do i find the jquery version Telerik is using?

Telerik asp.net ajax version 2021.616.45

 

Vessy
Telerik team
 answered on 05 Nov 2021
0 answers
216 views

Hello,

I want to apply widths to certain columns, that are defined by a user. Since the columns themselves don't provide a Width-property, I tried to use the column settings of the MasterTableView.

I create the ColumnSettings like this:

string[] columnWidths = {"125", "164", "64", "125"};

foreach (string columnWidth in columnWidths)
{
    Grid.MasterTableView.ColumnSettings.Add(new GridTableView.PersistableColumnSetting
    {
           Width = columnWidth
    });
}

 

But I can't find any method to apply these settings to a grid column.
Do I miss something or is there an easier way to set the width of a column?

 

Sven
Top achievements
Rank 1
 asked on 05 Nov 2021
1 answer
824 views

I am trying to get .xlsx export to not give this warning shown below. 

I am using a RadGrid that AutoGenerates columns. The RadGrid's culture is en-US. Need Data source gets a DataTable with one column and one row, with the value of -4.50. On ColumnCreated it makes the GridNumericColumn Currency type. The Grid displays the format properly. It also puts the value into excel as though it looks correct.

**The problem I currently see is that it is putting a line break after the value in excel. Not sure why this is happening with the export?

Example of code:

(.aspx file)

<div class="form-row mt-4">
            <div class="col-md">
                <div class="form-inline float-md-right">
                    <telerik:radajaxpanel runat="server" postbackcontrols="btnExportTest">
                        <asp:Button ID="btnExportTest" OnClick="btnExportTest_Click" runat="server" Text="Export" />
                    </telerik:radajaxpanel>
                </div>
            </div>
        </div>
        <div class="form-row mt-4">
            <div class="col-md">
                <telerik:RadGrid ID="Grid1" RenderMode="Lightweight" Skin="Bootstrap" runat="server" OnNeedDataSource="Grid1_NeedDataSource"
                    AllowFilteringByColumn="false" AllowPaging="false" AutoGenerateColumns="true" OnColumnCreated="Grid1_ColumnCreated">
                </telerik:RadGrid>
            </div>
        </div>

(.cs)

protected void Grid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            DataTable table = new DataTable();
            table.Columns.Add("currency", typeof(double));
            table.Rows.Add("-4.50");
            Grid1.DataSource = table;
        }

        protected void btnExportTest_Click(object sender, EventArgs e)
        {
            Grid1.ExportSettings.IgnorePaging = true;
            Grid1.ExportSettings.FileName = "test";
            Grid1.ExportSettings.ExportOnlyData = true;
            Grid1.ExportSettings.OpenInNewWindow = true;
            Grid1.ExportSettings.Excel.Format = GridExcelExportFormat.Xlsx;
            Grid1.MasterTableView.ExportToExcel();
        }

        protected void Grid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
        {
            if (e.Column is GridNumericColumn)
            {
                ((GridNumericColumn)e.Column).NumericType = NumericType.Currency;
            }
        }

I verified my windows settings are set up to show negative Currency with ($0.00).

This seems like it is just a problem with exporting from Telerik? Is there something that can make negative currencies export?

Currently using Q2 2021 Telerik version

Attila Antal
Telerik team
 answered on 04 Nov 2021
1 answer
192 views

Hi,

I can't get the scrollbars to show up. Below is the html of the whole page but it loads a page base too. Screenshot with a large image and no scrollbars is also attached.

Could something be suppressing them? If so, how can I identify or override?

 

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="DigitalAssetEdit.aspx.vb" Inherits="IronPoint.CM.WebUI.Admin.DigitalAssetEdit" %>
<%@ Register tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"%>
<%@ Register TagPrefix="ipuc" TagName="ActionBar" Src="~/cm/webui/usercontrols/ActionBar.ascx" %>

<script type="text/javascript">
  var imageEditor;
  var bUnsavedChanges;

  function imageEditor_load(sender, args) {
    imageEditor = sender;
    imageEditor.zoomBestFit();
  }

  function imageEditor_OnClientImageChanged(imEditor, eventArgs) {
    bUnsavedChanges = 1;
  }

  //parentURL will be populated only when Close button clicked. This will make the page redirect back to caller
  function saveImage(parentURL) {
    imageEditor.saveImageOnServer('', true);
    bUnsavedChanges = 0;
    openDAConfimSaveDialog(parentURL);
  }

  function exportImage(imageName) {
    imageEditor.saveImageOnClient(imageName, false);
  }

  function checkImageChanged(parentURL) {
    if (bUnsavedChanges == 1) {
      openDASaveDialog(parentURL);
    }
    else {
      closeWindow(parentURL);
    }
  }

  function openDASaveDialog(parentURL) {
    $Q("#tblDASaveDialogBox").dialog({
      buttons: {
        "Save": function () { saveImage(parentURL); closeDASaveDialog(); },
        "Discard": function () { closeWindow(parentURL); },
        "Cancel": function () { closeDASaveDialog(); }
      },
      modal: true,
      resizable: false,
      title: "Digital Asset Image Editor",
      width: 290,
      height: 210
    });
  }

  function closeDASaveDialog() {
    $Q("#tblDASaveDialogBox").dialog("close");
  }

  function closeWindow(parentURL) {
    window.location.assign(parentURL);
  }

  function openDAConfimSaveDialog(parentURL) {
    $Q("#tblDAConfimSaveDialogBox").dialog({
      buttons: {
        "OK": function () { closeConfimSaveDialog(parentURL); },
      },
      modal: true,
      resizable: false,
      title: "Digital Asset Image Editor",
      width: 290,
      height: 210,
      close: function () { closeConfimSaveDialog(parentURL); }
    });
  }

  function closeConfimSaveDialog(parentURL) {
    if (parentURL != null) {
      closeWindow(parentURL);
    }
    else {
      $Q("#tblDAConfimSaveDialogBox").dialog("close");
    }
  }

</script>

<ipuc:ActionBar ID="ctlActionBarTop" runat="server" ShowHelpIcon="true" />

<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
<telerik:RadImageEditor ToolsLoadPanelType="RadAjaxPanel" ID="RadImageEditor1" runat="server" ImageUrl="defaultimage.JPG" 
  Height="100%" Width="100%" EnableResize="true"
  OnClientLoad="imageEditor_load" OnClientImageChanged="imageEditor_OnClientImageChanged">
    <EditableImageSettings MaxJsonLength="50000000" />
    <Tools>
      <telerik:ImageEditorToolGroup>
        <telerik:ImageEditorTool CommandName="Print"/>
        <telerik:ImageEditorToolSeparator />
        <telerik:ImageEditorToolStrip Text="Undo" CommandName="Undo" />
        <telerik:ImageEditorToolStrip Text="Redo" CommandName="Redo" />
        <telerik:ImageEditorTool Text="Reset" CommandName="Reset" />
        <telerik:ImageEditorToolSeparator />
        <telerik:ImageEditorTool CommandName="Crop" />
        <telerik:ImageEditorTool CommandName="Resize" />
        <telerik:ImageEditorTool CommandName="Zoom" />
        <telerik:ImageEditorTool CommandName="ZoomIn"/>
        <telerik:ImageEditorTool CommandName="ZoomOut"/>
        <telerik:ImageEditorTool CommandName="Opacity" />
        <telerik:ImageEditorTool Text="Rotate" CommandName="Rotate" />
        <telerik:ImageEditorTool Text="Flip" CommandName="Flip" />
        <telerik:ImageEditorTool Text="Add Text" CommandName="AddText" />
        <telerik:ImageEditorTool Text="Insert Image" CommandName="InsertImage" />
        <telerik:ImageEditorTool Text="Brightness/Contrast" CommandName="BrightnessContrast" />
        <telerik:ImageEditorTool Text="Pencil" CommandName="Pencil" />
      </telerik:ImageEditorToolGroup>
    </Tools>
</telerik:RadImageEditor>

<div style="display:none" >
<table class="ipbSBModalPanelTable" id="tblDASaveDialogBox" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="align-content:center;">Do you want to save your changes?</td>
</tr>
</tbody>
</table>
</div>

<div style="display:none" >
<table class="ipbSBModalPanelTable" id="tblDAConfimSaveDialogBox" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="align-content:center;">Save Successful</td>
</tr>
</tbody>
</table>
</div>

<ipuc:ActionBar ID="ctlActionBarBottom" runat="server" ShowHelpIcon="true" />
Vessy
Telerik team
 answered on 04 Nov 2021
0 answers
700 views

Hello telerik community!

I'm currently working within a user form which contains a grid. I want to load the Update and Insert operations, and respective forms in another user control. I'm using 3 layer architecture. What am i missing?


<%@ Register Src="~/Views/Projectos/Equipa/ViewEmissaoTimeSheetEdit.ascx" TagPrefix="uc1" TagName="ViewEmissaoTimeSheetEdit" %> //Child reference in parent UC

<%@ Reference Control="~/Views/Projectos/Equipa/ViewEmissaoTimeSheetEdit.ascx" %>
ClassName="EditCommandColumn" //Reference in child User Control

<Telerik:RadGrid AllowAutomaticInserts="true" AllowAutomaticUpdates="true" On>

<Columns> <telerik:GridEditCommandColumn UniqueName="EditCommandColumn"> </telerik:GridEditCommandColumn> ... </Columns> <EditFormSettings UserControlName="ViewEmissaoTimeSheetEdit.acsx" EditFormType="WebUserControl" > <EditColumn UniqueName="EditCommandColumn1"></EditColumn> </EditFormSettings> </MasterTableView>


Thank you in advance :)
Harlem98
Top achievements
Rank 1
Iron
Iron
Iron
 asked on 03 Nov 2021
2 answers
225 views

Hello

I have problem i have one wsdl that is connected with Visual Studio. And i need add result of one get methode to table. My question is how, it is possible? I have any svc file, any asmx only wsdl https://www.um.poznan.pl/web-service/news?wsdl

I tried it


<%@ Page Language="VB" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="AskingTheWB._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div>
        <h3>RadGrid bound to Web Service</h3>
        <telerik:RadGrid RenderMode="Lightweight" runat="server" ID="RadGrid2" AllowPaging="true" AllowSorting="true"
            AllowFilteringByColumn="true" PageSize="1">
            <MasterTableView DataKeyNames="ProductID" ClientDataKeyNames="ProductID">
                <PagerStyle Mode="NumericPages" />
                <Columns>
                    <telerik:GridBoundColumn DataField="News" HeaderText="News" DataType="System.String">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings>
                <DataBinding SelectMethod="getNews" Location="https://www.um.poznan.pl/web-service/news" SortParameterType="Linq"
                    FilterParameterType="Linq">
                </DataBinding>
            </ClientSettings>
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>

but my table is empty. 

Aleksander
Top achievements
Rank 1
Iron
 answered on 03 Nov 2021
1 answer
652 views

I have a page with a popup RadWindow. In the RadWindow, users fill out a simple form and click on an OK button. The processing takes several seconds and sometimes users click on the OK button again. I am trying to find a way of disabling the OK button in javascript while the process runs, if the button is not in a RadAjaxPanel or one of the controls in a RadAjaxManager, the button does not change when it is disabled. When the button is n a RadAjaxPanel or one of the controls in a RadAjaxManager, I can't close the RadWindow.

I would think this is a pretty frequent issue. Anyone have any ideas? If you know of sample code that solves this I would really appreciate it!

Thanks

Vessy
Telerik team
 answered on 01 Nov 2021
0 answers
193 views

Hi,

I have the following snippet in my ASP.NET 

<TELERIK:RADMULTICOLUMNCOMBOBOX ID="RadMultiColumnComboBoxSearch" runat="server" Filter="startsWith" FilterFields="DrawingName, Description"
	Height="800" AllowPaging="true" EnableServerFiltering="true" MinLength="3" PageSize="60" DataTextField="DrawingName" DataValueField="DrawingID">
	<COLUMNSCOLLECTION>
		<TELERIK:MULTICOLUMNCOMBOBOXCOLUMN Field="DrawingID" Title="ID" />
		<TELERIK:MULTICOLUMNCOMBOBOXCOLUMN Field="DrawingName" Title="Name" />
		<TELERIK:MULTICOLUMNCOMBOBOXCOLUMN Field="Description" Title="Description" />
	</COLUMNSCOLLECTION>
	<WEBSERVICESETTINGS ServiceType="XML" Select-DataType="JSON" Select-Url="Default.aspx/GetDrawingsSuggestion" Select-RequestType="Post" />
</TELERIK:RADMULTICOLUMNCOMBOBOX>

[WebMethod()]
public static string GetDrawingsSuggestion(string filter)
{
	string filterText = HttpUtility.UrlDecode(filter);

	using (HEN_INTRANET_ProductionEntities dc = new HEN_INTRANET_ProductionEntities())
	{
		var q = from d in dc.tbl_ENECR_Drawings
				where (d.DrawingFlag == 1 | d.DrawingFlag == 2) && d.DrawingTypeID == 1
				select new
				{
					DrawingID = d.DrawingID,
					DrawingName = d.DrawingName,
					Description = d.Description,
				};
		var drawingsList = q.ToList();

		return Newtonsoft.Json.JsonConvert.SerializeObject(drawingsList);
	}
}

Can I use a page method service to get the data I need from the server?
Looking in Fiddler the call to the GetDrawingsSuggestion method occurs, but it returns the page contents. It does not execute the method. It just returns the rendered page.

Bart
Top achievements
Rank 1
 asked on 27 Oct 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?