Very large page size with many RadNumericTextboxes

3 posts, 0 answers
  1. Aaron Gibbs
    Aaron Gibbs avatar
    23 posts
    Member since:
    Dec 2007

    Posted 30 Oct 2012 Link to this post

    Good afternoon,

    I'm working on increasing the speed of a dynamically generated data entry page.  The page contains between 1 and 7 RadGrids, each with 20 or so rows, each row containing at least one RadNumericTextbox for data entry.  So, maybe 140 RadNumericTextboxes, as well as a handful of other controls such as RadComboBoxes and a couple RadWindows.

    I'm trying to reduce the page size which right now stands at about 3.5MB.  There is a VERY large block of Javascript at the bottom of the page containing the code to instantiate all the RadControls.  Hundreds of lines of Telerik code that all look something like this:
    Sys.Application.add_init(function() {
        $create(Telerik.Web.UI.RadNumericTextBox, {"_displayText":"","_focused":false,"_initialValueAsText":"","_postBackEventReferenceScript":"setTimeout(\"__doPostBack(\\\u0027entry20121022$rgSalesEntry$ctl00$ctl25$rwinNewSupplemental$C$rgSupplemental$ctl00$ctl36$txtSupplementalValue\\\u0027,\\\u0027\\\u0027)\", 0)","_skin":"Default","_validationText":"","clientStateFieldID":"entry20121022_rgSalesEntry_ctl00_ctl25_rwinNewSupplemental_C_rgSupplemental_ctl00_ctl36_txtSupplementalValue_ClientState","enabled":true,"incrementSettings":{InterceptArrowKeys:true,InterceptMouseWheel:true,Step:1},"numberFormat":{"DecimalDigits":2,"DecimalSeparator":".","CultureNativeDecimalSeparator":".","GroupSeparator":",","GroupSizes":3,"NegativePattern":"-n","NegativeSign":"-","PositivePattern":"n","AllowRounding":true,"KeepNotRoundedValue":false,"KeepTrailingZerosOnFocus":true,"NumericPlaceHolder":"n"},"styles":{HoveredStyle: ["width:70px;text-align:right;", "riTextBox riHover"],InvalidStyle: ["width:70px;text-align:right;", "riTextBox riError"],DisabledStyle: ["width:70px;text-align:right;", "riTextBox riDisabled"],FocusedStyle: ["width:70px;text-align:right;", "riTextBox riFocused"],EmptyMessageStyle: ["width:70px;text-align:right;", "riTextBox riEmpty"],ReadOnlyStyle: ["width:70px;text-align:right;", "riTextBox riRead"],EnabledStyle: ["width:70px;text-align:right;", "riTextBox riEnabled"],NegativeStyle: ["width:70px;text-align:right;", "riTextBox riNegative"]}}, {"valueChanged":txtValue_ValueChangedentry20121022}, null, $get("entry20121022_rgSalesEntry_ctl00_ctl25_rwinNewSupplemental_C_rgSupplemental_ctl00_ctl36_txtSupplementalValue"));
    });

    Is there any way to reduce or eliminate the size of this generated code at the bottom of the page?  I copied-and-pasted it out into a separate file and it's nearly half (1.6MB total) of my 3.5MB page size.

  2. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 31 Oct 2012 Link to this post

    Hi Aaron,

    Instead of the RadNumericTextBoxes use asp:TextBox and manage them with RadInputManager. You can add each text box to NumericTextBoxSetting dynamically during the ItemCreated of your grid. This way you will reduce the scripts and improve the overall performance.

    Regards,
    Vasil
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Aaron Gibbs
    Aaron Gibbs avatar
    23 posts
    Member since:
    Dec 2007

    Posted 05 Nov 2012 Link to this post

    Thank you, I see this documented in the Help now and looks like it will make a big difference.
Back to Top