Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
211 views

I am dynamically adding RadFilter editors, such as  RadFilterTextFieldEditor, to RadFilter, server side.

When the web page is running, if a user enters certain "dangerous" text strings such as "<!--" or "<script>" into the RadFilterTextFieldEditor, the RadFilter control stops functioning (you can no longer add new expressions or groups to your Filter expression).  If I try to navigate to another page in my web app, I get logged out because my session has been destroyed/lost.  There MAY be an unhandled "A potentially dangerous Request.Form value was detected" exception that is causing the user session to be destroyed.

My fix would be to intercept the RadFilterTextFieldEditor text and strip any potentially dangerous user input (such as embedded JavaScript).

I do not see an OnBlur/OnChange event on the RadFilterTextFieldEditor that I could use to intercept the user input before it is posted.

I tried adding an asp.net validator on the RadFilter control but that does not work because RadFilter is not an "input" type of control.

I looked at the RadFilter client side events (OnFilterCreated/OnFilterCreating) but those do not appear to allow me to strip the user text input before it is too late.

Can you suggest a way to handle RadFilterTextFieldEditor text to prevent users from entering "dangerous" text.

Courtney

 

Attila Antal
Telerik team
 answered on 06 Aug 2020
1 answer
140 views

Hi Team,
    I am using RadMultiPage and controls added in RadPageView, when i run asp page i get mouse out and mouse over actions on same time, when i mouse over it calendar icon just move from rights, the ordinary behavior is  just change the icon color from grey to blue, but here appear both color icon just move right to left.

 

     <telerik:RadMultiPage ID="SideOperationsPage" Width="100%" Height="100%"  ScrollBars="none"
                            runat="server" SelectedIndex="0">
                            <telerik:RadPageView ID="DefaultPage" Width="100%" Height="100%" runat="server">

                                <div style="width: 100%; height: 100%; overflow: auto;">

<table>

<tr>

  <td style="width: 60%;" align="center">
                                                <telerik:RadDatePicker ID="dcreatedto" DateInput-DateFormat="dd/MM/yyyy" Width="97%" runat="server">
                                                    <Calendar ID="Calendar2" runat="server">
                                                        <SpecialDays>
                                                            <telerik:RadCalendarDay Repeatable="Today" ItemStyle-BackColor="Yellow">
                                                            </telerik:RadCalendarDay>
                                                        </SpecialDays>
                                                    </Calendar>
                                                </telerik:RadDatePicker>
                                            </td>

</tr>

</table>

</div>

</telerik:RadPageView>

    <telerik:RadPageView ID="CustomPage" Width="100%" Height="100%" runat="server">

                                <div style="width: 100%; height: 100%; overflow: auto;">

                                    

<table>
<tr>
  <td style="width: 60%;" align="center">
                                                <telerik:RadDatePicker ID="dcreatedfrom" DateInput-DateFormat="dd/MM/yyyy" Width="97%" runat="server">
                                                    <Calendar ID="Calendar2" runat="server">
                                                        <SpecialDays>
                                                            <telerik:RadCalendarDay Repeatable="Today" ItemStyle-BackColor="Yellow">
                                                            </telerik:RadCalendarDay>
                                                        </SpecialDays>
                                                    </Calendar>
                                                </telerik:RadDatePicker>
                                            </td>
</tr>
</table>

                                    

                                </div>

                            </telerik:RadPageView>
                        </telerik:RadMultiPage>

 

Same as combobox also behave like that 

 

Here the screenshot

Combobox

Before mouse hover -- http://prntscr.com/t9pmju

After mouse hover --http://prntscr.com/t9pmt8

 

 

Calendar

Before mouse hover -- http://prntscr.com/t9pb50

After mouse hover -- http://prntscr.com/t9pena

 

Note : That RadMultiPage in div control which is call div control like sliding drawer.

Pls reply asap

Thanks

M Kumar
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 06 Aug 2020
1 answer
213 views

Hi Team,

Recently we upgraded the telerik version on our web app, and experiencing 60% increase in the loading time. 

Version upgraded to - 2020.1.219.45

Issues with both loading the content on grid , also the export feature ( export to excel ) went upto 100% increase in loading time. 

Pls help us to fix these performance issues. 

 

With regards

Shankar M

Doncho
Telerik team
 answered on 05 Aug 2020
1 answer
2.1K+ views

Hello,

The project that i'm working on uses Telerik version 2013.3.1324.40 and recently the following error happened in our client (see attached image for more details):

Uncaught TypeError: Cannot read property 'parentNode' of null at Object._endRequest (Telerik.Web.UI.WebRe...e41%3ae4f8f289:6089)

When analyzing the JS line in which the problem occurred we realized that it is related to the panels that Ajax uses to update the page objects (in this case, the absence of them).

However, so far we have not been able to simulate the situation and the customer himself confirmed that the error is irregular and after the error happens they reenter the page and do the same action and it works just fine.

If possible, we would be grateful if you could guide us to what may be causing the error in order to correct it.

Note: I apologize for any grammatical errors as english is not my first language.

Best regards,

Vessy
Telerik team
 answered on 05 Aug 2020
13 answers
3.6K+ views
Hi all,

how to use find control in rad grid item command ... i have two text boxes. i wish to retrieve the values from that textboxes inside the rad grid item command.. please help how it's possible...

Regards,
Prassin
Roger
Top achievements
Rank 1
Veteran
 answered on 04 Aug 2020
4 answers
335 views

Hello,

I've got a problem. I've got a pie with two values. Sometimes it happens, that both values are 0.
If that happens, the Piechart will get transparent.

I already added a second series, but the gray part is still clickable and tooltip appears.

Is there any possibility to show a whole gray pie if there are no values?

Regards

Vessy
Telerik team
 answered on 04 Aug 2020
10 answers
371 views
hi,
what is the event for grid column resize?
In my application,when i am resizing the grid column i have to change that column data.
Doncho
Telerik team
 answered on 04 Aug 2020
12 answers
688 views
Hi, I create a RadOrgChart page.  But it's not fit into the screen. I  would like to make it smaller.  My Telerik version is 2011.3.1115.40. 
I attached my screen's screen shot.

Here is my Code;
<%@ Page Title="" Language="C#" MasterPageFile="~/Controls/MasterPages/User.master" Theme="Default" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Sections_OrgChart_Default" %>
  
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
  
  
<telerik:RadOrgChart runat="server" ID="RadOrgChart1" ></telerik:RadOrgChart>
  
</asp:Content>
And my Cs codes, 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Getron.AAM;
using Getron.AAM.EntityManagement;
using Getron.Core.Base.Objects;
using System.Data;
  
public partial class Sections_OrgChart_Default : EntityProtectedPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        OrgSchema osch = new OrgSchema();
        QueryEntity qent = new QueryEntity();
        qent.QueryEntityType = Getron.Core.Enums.EQueryEntityType.WhereCondition;
        qent.Query = "SupervisorId=@SupervisorId";
        Getron.DBInterface.Parameter p0 = new Getron.DBInterface.Parameter("@SupervisorId", ParameterDirection.Input, DbType.Int64, 0);
        p0.Value = 23;
        qent.Parameters.Add(p0);
  
        DataTable dt = new DataTable();
        dt = osch.GetCustomViewAll("OrgSchemaAllData", new List<string>() { "SystemUserIntCode", "SystemUserName", "SuperVisorId" }, qent);
  
        RadOrgChart1.DataTextField = "SystemUserName";
        RadOrgChart1.DataFieldID = "SystemUserIntCode";
        RadOrgChart1.DataFieldParentID = "SupervisorId";
  
        RadOrgChart1.DataSource = dt;
        RadOrgChart1.DataBind();
    }
}

Vessy
Telerik team
 answered on 04 Aug 2020
1 answer
186 views

I am trying to create a Master/Detail RadGrid, wherein the Grid is being populated at Client side using Web Service JSON data. I find that on setting the data source and binding through AJAX, the hierarchical data is not being generated. Can anyone please let me know what's the issue with this? Whether in the first place this use case is supported?

<telerik:RadGrid AllowFilteringByColumn="False" AllowPaging="False" AllowSorting="True" AutoGenerateColumns="False" CellPadding="0" CellSpacing="0" CssClass="gridCrossRoads" GridLines="None" ID="gridManageCases" runat="server">
    <ClientSettings AllowGroupExpandCollapse="false" EnableAlternatingItems="false" EnableRowHoverStyle="true">
        <Scrolling AllowScroll="true" UseStaticHeaders="true" />
        <Selecting AllowRowSelect="True" />
        <ClientEvents OnRowDataBound="GridRowBound" OnHierarchyExpanding="HierarchyExpanding"></ClientEvents>
    </ClientSettings>
    <MasterTableView AllowFilteringByColumn="False" AllowNaturalSort="False" ClientDataKeyNames="YouthId" DataKeyNames="YouthId" EnableColumnsViewState="False" EnableViewState="False" HierarchyLoadMode="Client" NoMasterRecordsText="<div class='noRec'>No records to display.</div>" TableLayout="Auto">
        <Columns>
            <telerik:GridBoundColumn DataField="YouthId" HeaderText="Youth ID" UniqueName="YouthId">
                <HeaderStyle CssClass="gridHeader" Width="10%" />
                <ItemStyle CssClass="gridItem" Width="10%" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Name" HeaderText="Name" UniqueName="Name">
                <HeaderStyle CssClass="gridHeader" Width="25%" />
                <ItemStyle CssClass="gridItem" Width="25%" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Gender" HeaderText="Gender" UniqueName="Gender">
                <HeaderStyle CssClass="gridHeader" Width="10%" />
                <ItemStyle CssClass="gridItem" Width="10%" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Age" HeaderText="Age" UniqueName="Age">
                <HeaderStyle CssClass="gridHeader" Width="10%" />
                <ItemStyle CssClass="gridItem" Width="10%" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Phone" HeaderText="Phone" UniqueName="Phone">
                <HeaderStyle CssClass="gridHeader" Width="10%" />
                <ItemStyle CssClass="gridItem" Width="10%" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="ZipCode" HeaderText="Zip Code" UniqueName="ZipCode">
                <HeaderStyle CssClass="gridHeader" Width="10%" />
                <ItemStyle CssClass="gridItem" Width="10%" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Status" HeaderText="Status" UniqueName="Status">
                <HeaderStyle CssClass="gridHeader" Width="10%" />
                <ItemStyle CssClass="gridItem" Width="10%" />
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn UniqueName="Temp">
                <HeaderStyle CssClass="gridHeader" Width="15%" />
                <ItemStyle HorizontalAlign="Center" Width="15%" />
            </telerik:GridTemplateColumn>
        </Columns>
        <NestedViewTemplate>
            <div class="viewWrap">
                <telerik:RadTabStrip EnableViewState="False" ID="tbGrd" MultiPageID="multiPage" runat="server" SelectedIndex="0">
                    <Tabs>
                        <telerik:RadTab Owner="tbGrd" PageViewID="pBasic" runat="server" Selected="True" Text="Identification" Value="identification">
                        </telerik:RadTab>
                        <telerik:RadTab Owner="tbGrd" PageViewID="pOthers" runat="server" Text="Contact" Value="contact">
                        </telerik:RadTab>
                        <telerik:RadTab Owner="tbGrd" PageViewID="pSkills" runat="server" Text="Referral" Value="referral">
                        </telerik:RadTab>
                        <telerik:RadTab Owner="tbGrd" PageViewID="pNotes" runat="server" Text="Options" Value="options">
                        </telerik:RadTab>
                        <telerik:RadTab Owner="tbGrd" PageViewID="pAct" runat="server" Text="Calls" Value="calls">
                        </telerik:RadTab>
                    </Tabs>
                </telerik:RadTabStrip>
                <telerik:RadMultiPage CssClass="pageView" EnableViewState="False" ID="multiPage" runat="server" SelectedIndex="0">
                    <telerik:RadPageView ID="pageIdentification" runat="server">
                        <div id="dBas" runat="server">
                            This is the first tab
                        </div>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="pageContact" runat="server">
                        <div id="dOth" runat="server">
                            this is the second tab
                        </div>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="pageReferral" runat="server">
                        <div id="dSkl" runat="server">
                            this is the third tab
                        </div>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="pageOptions" runat="server">
                        <div id="dNot" runat="server">
                            this si the fourth tab
                        </div>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="pageCalls" runat="server">
                        <div id="dSub" runat="server">
                            this is the fifth tab
                        </div>
                    </telerik:RadPageView>
                </telerik:RadMultiPage>
            </div>
        </NestedViewTemplate>
    </MasterTableView>
</telerik:RadGrid>

 

    <script>
        $(document).ready(function()
        {
            var GridNewCases = $find(arrayControl[0]);
            var GridNewCasesMaster = GridNewCases.get_masterTableView();
//Data is fetched here
            //setTimeout(GetNewCasesData, 100);
 
//Though this is new function this is how the datasource is setup:
    GridNewCasesMaster.set_dataSource((result && result.Data) ? result.Data : []);
    GridNewCasesMaster.dataBind();
 
 
        });
       </script>

 

This is the datasource that is retrieved.

{"d":{"Data":[{"Id":2,"YouthId":"CR0000002","Name":"Mani Venkiteswaran","Gender":"Others/Unknown","Age":20,"Phone":"(123) 456-7890","ZipCode":"18940-","Status":"New"},{"Id":5,"YouthId":"CR0000005","Name":"Venrall Jamanison","Gender":"Male","Age":8,"Phone":"(988) 554-4633","ZipCode":"18940-","Status":"New"},{"Id":6,"YouthId":"CR0000006","Name":"Jermey Smith","Gender":"Male","Age":15,"Phone":"(554) 889-6633","ZipCode":"18940-","Status":"New"},{"Id":7,"YouthId":"CR0000007","Name":"Walter Nelson","Gender":"Male","Age":16,"Phone":"(558) 733-1225","ZipCode":"18942-","Status":"New"}]}}

 

At the code behind this is the code:

protected void Page_Load(object sender, EventArgs e)
{
    if (Page.IsPostBack)
    {
        return;
    }
 
    gridManageCases.DataSource = new List<object>();
    gridManageCases.AutoGenerateHierarchy = true;
}

 

 

 

Please let me know how this can be done. I found one code sample on your site from 2008, though the steps are same what I am doing but then I should be knowing much changes have happened since the assembly was released back in 2008 to now.

Thanks.

Mani
Top achievements
Rank 1
 answered on 02 Aug 2020
0 answers
150 views

I ran across a minor but annoying problem with sending a time back from the handler through a custom result.  Using datatype DateTime will not work.  The value comes through from the server as a long timestamp, which is wonderful, but that does not parse to a DateTime directly. It has to be a string-ified.  However, this cannot be done in the OnFileUploaded event because by then the server has already choked on converting Date(long value) to a DateTime.  The solution is to use a timestamp represented as a long datatype  for the result property, send that across , and decode / parse on the other end (client side) as desired. like this:

In the custom result:

        /// instant of file upload
        /// this is a timestamp
        public long UploadTimeStampUTC
        {
            get;
            set;
        } = new DateTimeOffset(System.DateTime.Now.ToUniversalTime()).ToUnixTimeMilliseconds(); // this is overkill

          public int UploadResultStatusCode { get; set; } // whatever code you want

        public string UploadResultMessage // happy.. or very, very  sad
        {
            get;
            set;
        } 

(not all properties shown....)

 

 

In the handler
...

..

 var tsLong = new DateTimeOffset(System.DateTime.Now.ToUniversalTime()).ToUnixTimeMilliseconds();
                    result.UploadTimeStampUTC = tsLong;

result.myUploadTime = tsLong ;

....

...

 result.UploadResultMessage = $"Status Code: {result.UploadResultStatusCode} - Process Result Message: {logMsg} {Environment.NewLine}" +
                        $"Original FileName: {file.FileName}{Environment.NewLine}" +
                        $"TempUploadFileName {FullPath.Replace(System.IO.Path.DirectorySeparatorChar, System.IO.Path.AltDirectorySeparatorChar)}{Environment.NewLine}" +
                        $"UploadResultFileName: {result.UploadResultFileName}{Environment.NewLine}" +
                        $"UploadResultPhysicalFileName: {result.PhysicalFileName}{Environment.NewLine}" +
                        $"UploadDateTime: {(Helpers.UnixTimeStampToDateTime(tsLong).ToString("F", CultureInfo.CreateSpecificCulture("en-US")))}";

return result;

...

 

In OnFileUploaded:

...

...

 LBISAsyncUploadResultError result = e.UploadResult as LBISAsyncUploadResultError;
            Log?.Debug(result.UploadResultMessage);
            Log?.Debug($"Filename on disk: {result.PhysicalFileName}");
            Log?.Debug($"TITLE: {e.File.GetFieldValue("Title")}");
            Log?.Debug($"NOTES: {e.File.GetFieldValue("Notes") }");
            Log?.Debug($"TIMESTAMP (as long): {result.UploadTimeStampUTC.ToString()}");
            Log?.Debug($"DATETIME: {(Helpers.UnixTimeStampToDateTime(result.UploadTimeStampUTC).ToString("F", CultureInfo.CreateSpecificCulture("en-US")))}");

 

the results look like:

...

...

2020-08-01 10:12:53,642 [13] DEBUG LOGGER [] - Status Code: 100 - Process Result Message: Uploaded successfully 
Original FileName: BrM6 - Troubleshooting-memo.pdf
TempUploadFileName D:/git/LBIS9/src/SupportDocuments/_tmp_RadUpload/1596291166563BrM6 - Troubleshooting-memo.pdf.tmp
UploadResultFileName: BrM6 - Troubleshooting-memo_[60051].pdf
UploadResultPhysicalFileName: D:/git/LBIS9/src/SupportDocuments/ExstPlans/BrM6 - Troubleshooting-memo_[60051].pdf
UploadDateTime: Saturday, August 1, 2020 14:12:48
2020-08-01 10:12:53,642 [13] DEBUG LOGGER [] - Filename on disk: D:/git/LBIS9/src/SupportDocuments/ExstPlans/BrM6 - Troubleshooting-memo_[60051].pdf
2020-08-01 10:12:53,642 [13] DEBUG LOGGER [] - TITLE: aaa
2020-08-01 10:12:53,643 [13] DEBUG LOGGER [] - NOTES: BBB
2020-08-01 10:12:53,643 [13] DEBUG LOGGER [] - TIMESTAMP (as long): 1596291168252
2020-08-01 10:12:53,643 [13] DEBUG LOGGER [] - DATETIME: Saturday, August 1, 2020 14:12:48

...

 

and this.... for which I cannot claim any credit

            /// <summary>
        /// Take a long that is a timestamp and make a datetime
        /// </summary>
        /// <param name="unixTimeStamp"></param>
        /// <returns></returns>
        public static DateTime UnixTimeStampToDateTime(long unixTimeStamp)
        {
            var UnixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc);
 
            UnixEpoch = UnixEpoch.AddMilliseconds(unixTimeStamp);
            return UnixEpoch;
        }
        /// <summary>
        /// Take a DateTimeOffset and return a DateTime
        /// </summary>
        /// <param name="ts"></param>
        /// <returns></returns>
        public static DateTime DateTimeOffSetToDateTime(DateTimeOffset ts)
        {
            return DateTime.Parse(ts.ToString());
        }

 

Allen
Top achievements
Rank 2
Iron
Veteran
 asked on 01 Aug 2020
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?