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

error When using RenderMode in RadGrid

6 Answers 61 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Amir
Top achievements
Rank 1
Amir asked on 02 Oct 2018, 11:48 AM

Hello Guys

I have a problem. When i using RenderMode in RadGrid , I got this error:

Specified argument was out of the range of valid values.

Parameter name: valueDescription: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: value

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace: 

[ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: value] System.Web.UI.WebControls.Unit.GetTypeFromString(String value) +3065878 System.Web.UI.WebControls.Unit..ctor(String value, CultureInfo culture, UnitType defaultType) +261

.

.

.

This is my aspx:

<telerik:RadGrid ID="gvRad2" runat="server" OnNeedDataSource="gvRad2_OnNeedDataSource"
            utoGenerateColumns="false" AllowPaging="true"
            AllowSorting="True"
            AllowFilteringByColumn="True"
            RenderMode="Lightweight">
            <MasterTableView DataKeyNames="PostLetterID" CommandItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage">
                <Columns>
                    <telerik:GridBoundColumn DataField="PostLetterID" HeaderText="haha"
                        
                        ReadOnly="true"
                        ForceExtractValue="Always" ConvertEmptyStringToNull="true" AllowFiltering="False"></telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>

6 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 03 Oct 2018, 07:26 AM
Hello,

You have set properly the RenderMode inside the RadGrid declaration. Is it possible that you are using an older version which does not offer lightweight rendering?

Can you please upgrade to the latest version of Telerik.Web.UI.dll which is 2018.3.910 (R3 2018) and test again?

If the problem still persists, set the RenderMode property via the web.config file: 

<appSettings>
    <add key="Telerik.Web.UI.RenderMode" value="lightweight" />
</appSettings>

Best regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
negar
Top achievements
Rank 1
answered on 14 Aug 2019, 12:22 PM

Hello

I'm using Telerik version R2 2019.2.514 but I get the same error for RenderMode="Mobile" or RenderMode="Auto" in radGrid !!

0
negar
Top achievements
Rank 1
answered on 14 Aug 2019, 01:18 PM
Server Error in '/' Application.
Specified argument was out of the range of valid values.
Parameter name: value
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: value
 
Source Error:
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
 
Stack Trace:
 
 
[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: value]
   System.Web.UI.WebControls.Unit.GetTypeFromString(String value) +3065866
   System.Web.UI.WebControls.Unit..ctor(String value, CultureInfo culture, UnitType defaultType) +261
   Telerik.Web.UI.GridPagerItemDecorator.SetItemStyle(GridTableView owner) +753
   Telerik.Web.UI.GridPagerItemDecorator.DecorateItem(GridTableView owner, GridColumn[] columnArray) +15
   Telerik.Web.UI.GridItem.PrepareItemStyle() +288
   Telerik.Web.UI.GridPagerItem.PrepareItemStyle() +63
   Telerik.Web.UI.GridMultiRowItem.PrepareItemStyle() +102
   Telerik.Web.UI.RadGrid.PrepareRows(GridTableView view) +444
   Telerik.Web.UI.RadGrid.Render(HtmlTextWriter writer) +93
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +66
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   Telerik.Web.UI.ControlRenderer.Render(HtmlTextWriter writer) +118
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +66
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
0
Rumen
Telerik team
answered on 15 Aug 2019, 02:52 PM
Hi Negar,

Can you please isolate the problem in a simple runnable project and send it for examination so that we can research it?

You can use the attachment functionality of the support ticketing system under your account to submit the project.

Thank you very much for your assistance on reproducing this problem!

Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
negar
Top achievements
Rank 1
answered on 18 Aug 2019, 04:55 AM

Hello
I found the error.

This error is due to the overlap between the two properties of RenderMode="..." and AllowPaging="true". I had to do one of the following to avoid an error.
Set the AllowPaging="false"
Or
RenderMode="Classic"
What is the reason?
But I need AllowPaging.

Thank you very much for your guidance and accountability

0
Vessy
Telerik team
answered on 20 Aug 2019, 02:56 PM

Hi Negar,

Such behavior is usually faced when there are mixed render modes used on the same page. Can you, please, remove all RenderMode declarations from the markup of the controls and see if adding the following key to the web.config will make a difference?

<appSettings>
    <add key="Telerik.Web.UI.RenderMode" value="lightweight" />
</appSettings>

If this does not help it will be really helpful if you send us a runnable sample where we can reproduce the issue and examine further the exact setup leading to it. You can see how to prepare such easily here: https://www.telerik.com/blogs/isolating-a-problem-in-a-sample-project

Regards, Vessy
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
Amir
Top achievements
Rank 1
Answers by
Rumen
Telerik team
negar
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or