This is a migrated thread and some comments may be shown as answers.

Very large page size with many RadNumericTextboxes

2 Answers 48 Views
Input
This is a migrated thread and some comments may be shown as answers.
Aaron Gibbs
Top achievements
Rank 2
Aaron Gibbs asked on 30 Oct 2012, 09:45 PM
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 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 31 Oct 2012, 08:53 AM
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.
0
Aaron Gibbs
Top achievements
Rank 2
answered on 05 Nov 2012, 06:45 PM
Thank you, I see this documented in the Help now and looks like it will make a big difference.
Tags
Input
Asked by
Aaron Gibbs
Top achievements
Rank 2
Answers by
Vasil
Telerik team
Aaron Gibbs
Top achievements
Rank 2
Share this question
or