Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
401 views

I am trying to use the self-referencing hierarchy functionality of the grid but not working properly when we have huge data.

We are getting the error as follows,

 "Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property."

When i googgled,i got the following code snippet has to be added in  the web.config to increase the maxJsonLength property:

 <system.web.extensions>
    <scripting>
      <webServices>
        <jsonSerialization maxJsonLength="500000">
        </jsonSerialization>
      </webServices>
    </scripting>
  </system.web.extensions>

We also tried to increase the maxJsonLength value. But still  getting the same error.

My code:

.aspx page:

<telerik:RadGrid ID="RadGrid1" runat="server" Skin="" Width="97%" GridLines="None"
        ShowHeader="False">
        <MasterTableView HierarchyDefaultExpanded="True" HierarchyLoadMode="Client" DataKeyNames="ID,ParentScheduleID"
            Width="100%" AutoGenerateColumns="False">
            <SelfHierarchySettings ParentKeyName="ParentScheduleID" KeyName="ID" MaximumDepth="2"  />
            <Columns>
                <telerik:GridBoundColumn DataField="ScheduleName" HeaderText="ScheduleName" UniqueName="ScheduleName">
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>

.aspx.cs:(code behind)

  protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {        

            BindGrid();
        }
    }

    public void BindGrid()
    {
        DBLayer objDbLayer= new DBLayer();    

        DataSet dsSchedules = objDbLayer.GetScheduleData(ProjectId);

        if (dsSchedules.Tables.Count > 0)
        {           
            RadGrid1.DataSource = dsSchedules.Tables[0];

            RadGrid1.DataBind();
        }


    }

kindly help to resolve this error.

Thanks & Regards,

Venkatraman Gururaj.

Rumen
Telerik team
 answered on 18 Nov 2024
1 answer
148 views
 Hi I am using telerik:RadEditor control when i try to load the file into editor window i am getting "Error while executing filter CleanAttributesFilter - RangeError: Maximum call stack size exceeded" error. im getting this error oly my file size is more then 3MB HTML text. Can some one help me out how to resolve this ?
Rumen
Telerik team
 answered on 15 Nov 2024
2 answers
403 views

look at you site it doesnt work on here either

https://demos.telerik.com/aspnet-ajax/multiselect/serversideevents/defaultcs.aspx

Vasko
Telerik team
 answered on 15 Nov 2024
1 answer
59 views

I am using a function that updates the style of the input controls on a webform.

<script>
$(function () {
if (typeof ValidatorUpdateDisplay != 'undefined') {
var originalValidatorUpdateDisplay = ValidatorUpdateDisplay;
ValidatorUpdateDisplay = function (val) {
if (!val.isvalid) {
$("#" + val.controltovalidate).css("border", "1px solid #C00");
}
else {
$("#" + val.controltovalidate).css("border", "0px solid #777");
}
originalValidatorUpdateDisplay(val);
}
}
});
</script>

<telerik:RadDatePicker ID="rdpServiceDateFrom" runat="server" MinDate="1/1/1900" MaxDate='<%# Now() %>' Width="100px" >
<Calendar ID="Calendar9" runat="server" ShowRowHeaders="false">
<SpecialDays>
<telerik:RadCalendarDay Repeatable="Today" ItemStyle-BackColor="#DDEEFF" />
</SpecialDays>
</Calendar><DateInput CssClass="requiredField" DateFormat="MM/dd/yy" Width="1"></DateInput>
</telerik:RadDatePicker>
<asp:RequiredFieldValidator ID="rfvrdpServiceDateFrom" runat="server" ControlToValidate="rdpServiceDateFrom" ErrorMessage="Service Date is required" ValidationGroup="ValidationGroupGetAProcedure" Display="None" />

All works well with other controls on the form (RadTextBox, RadDropdown, etc), but it cannot set the style on a RadDatePicker
Any ideas on how this can be modified or a workaround?

Vasko
Telerik team
 answered on 11 Nov 2024
1 answer
68 views

Hi,

Been using Telerik UI for ASP.NET AJAX from 2012.
This year we decided to update to newer version.

When we started using the newer version we started having some layout related problems.
We have not made any changes to our code between updating the Telerik package.

When creating an appointment in scheduler we have added three custom attributes, BookedBy, Created and Temperatur.
The three attributes are shown but they show the property name instead of the custom label we have set for the control as shown in third picture.

First picture shows how the GUI have looked so far.
Second picture shows how the GUI looks after changing to the newer version.
Third and fourth pictures are screen dumps of the code.

Thanks in advance for any help you can give.

Edit

I realize my initial post wasn't very clear on my question.

My question is how to get the label of the custom attributes in
the appointment window, to be different from the names given in the telerik:Radscheduler tag.

In the older version of telerik package you could override the label shown in the appointment window.
In earlier version of telerik UI package this was done in the function you set in onformedcreated parameter of telerik:Radscheduler tag,
get the control linked to the custom attribute using following code:

RadTextBox CreatedByTextbox = (RadTextBox)e.Container.FindControl("AttrBookedBy");

and then change the label shown by changing the label of the control:

CreatedByTextbox.Label = "Skapad av:";

However in newer version of telerik UI package this doesn't seem to give the same behavior any more.

In my example I want the custom attribute BookedBy label in appointment window to be shown as "Skapad av:", how would I go about getting this behavior?

Joakim
Top achievements
Rank 1
 updated question on 11 Nov 2024
3 answers
253 views

I'm looking for an example of how to insert a row, with data, into a radgrid. I've seen examples of how to trigger the insert command from Javascript.  But I want more than just a new, empty row that the user can type into.  I want to add a new, completed row, with data, to what is already bound to the grid, from Javascript.

Let's assume I have some JSON data (returned by an ajax call, for example) that I want to add as a new row into an existing radgrid on the page, all client side, Javascript based.  I'm assuming that when the page is eventually posted back, I can then also iterate over all the rows (those orginally bound when the page was first rendered and any subsequent rows that were added by Javascript).

Any sample code or suggested links would be appreciated.

 

 

Rumen
Telerik team
 answered on 08 Nov 2024
6 answers
86 views

Good afternoon,

I am using ASP.NET AJAX version 2023.3.1010.45,

I have a page with a ComboBox and Grid.  By choosing an Item in the ComboBox and clicking a Button, it will locate the Item in the Grid.  If an Item is inserted into or deleted from the Grid, the ComboBox needs to update.  Both controls have the same ObjectDataSource as their data source.  This is why they share an Ajax Panel.

I am using a RadAjaxManager and RadAjaxLoadingPanel as follows (setting UpdatePanelsRenderMode to Inline):

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdatePanelsRenderMode="Inline">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadComboItems">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGridItems"/>
                    <telerik:AjaxUpdatedControl ControlID="RadComboItems" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGridItems">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGridItems" />
                    <telerik:AjaxUpdatedControl ControlID="RadComboItems" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default" BackgroundTransparency="30" RenderMode="Lightweight">
    </telerik:RadAjaxLoadingPanel>

The ComboBox and Grid appear in the same RadAjaxPanel (also with RenderMode Inline):

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1" RenderMode="Inline">
    <label for="RadComboItems">Input/Select Item:</label>
    <telerik:RadComboBox ID="RadComboItems" runat="server" Height="200px" Width="200px" DataSourceID="odsItems" EnableVirtualScrolling="true" DataTextField="ItemId" DataValueField="RowNum" EmptyMessage="--Select a value--" RenderMode="Lightweight" EnableAjaxSkinRendering="true">
    </telerik:RadComboBox>
    <telerik:RadButton RenderMode="Lightweight" runat="server" Text="Select" ID="btnFindItems" OnClick="btnFindItems_Click" EnableAjaxSkinRendering="true" />

    <telerik:RadGrid ID="RadGridItems" RenderMode="Lightweight" runat="server" AllowPaging="True" DataSourceID="odsItems" AllowSorting="True" AllowAutomaticUpdates="True" AllowAutomaticInserts="True" AllowAutomaticDeletes="True" OnUpdateCommand="RadGridItems_UpdateCommand"                                    OnItemDataBound="RadGridItems_ItemDataBound" OnItemCommand="RadGridItems_ItemCommand" OnItemDeleted="RadGridItems_ItemDeleted" OnItemInserted="RadGridItems_ItemInserted" OnItemUpdated="RadGridItems_ItemUpdated" OnPreRender="RadGridItems_PreRender" CellSpacing="-1" GridLines="Horizontal" OnDetailTableDataBind="RadGridItems_DetailTableDataBind" AllowFilteringByColumn="true" OnInfrastructureExporting="RadGridItems_InfrastructureExporting">
....
....
    </telerik:RadGrid>
</telerik:RadAjaxPanel>

When the page first renders, the ComboBox and Button render as expected:

<div class="RadAjaxPanel" id="ctl00_maincontent_ctl00_maincontent_RadComboItemsPanel" style="display: inline;">

Once the Button is pressed though, the rendering changes to Block:

<div class="RadAjaxPanel" id="ctl00_maincontent_ctl00_maincontent_RadComboItemsPanel">

Is there anyway to prevent this from happening, without having to specify this on the page:

    <style type="text/css">
        .RadAjaxPanel
        {
            display: inline !important;
        }
    </style>

Kind regards,

Richard

Rumen
Telerik team
 answered on 06 Nov 2024
2 answers
50 views

I want to restrict the editing of a RadEditor, but I don't want to set its server-side Enabled property to false. 

Using client-side JavaScript, I'm using editor.enableEditing(false), but this still allows the user to delete or backspace to remove content.  It does not allow adding new content, nor respond to any other key.

I've tried to add an event listener for the onkeydown and keydown event to prohibit the delete and backspace keys, but that doesn't stop the user from deleting content, either. 

While debugging, I noticed that the content gets deleted prior to hitting the e.preventDefault() that is intended to stop it. 

How can I accomplish this task?


editor.enableEditing(false);
     editor.get_contentArea().onkeydown = e => {                         
         if (e.keyCode === 8 || e.keyCode === 46) { // Prevent Backspace (8) and Delete (46)
             e.preventDefault();
             e.stopPropagation();
             e.stopImmediatePropagation();
             return false;
         }
     };
                

Rumen
Telerik team
 answered on 02 Nov 2024
1 answer
67 views

Good morning! I would like to know if it is possible to save the state of the radtreelist with the nodes that were opened or closed and this way when the user reloads the screen it will be displayed the way it was before?

Radtreelist asp.net c#

Vasko
Telerik team
 answered on 31 Oct 2024
1 answer
52 views

Two issues on the RadScheduler Weekview column header:

  1. How to disable the clickable link in the column header?
  2. We want to only show dayname as header eg. "Sunday Monday Tuesday". What format string to use herefore?

Thanks,

Marc

 

Vasko
Telerik team
 answered on 31 Oct 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?