error When using RenderMode in RadGrid

7 posts, 0 answers
  1. Amir
    Amir avatar
    1 posts
    Member since:
    Oct 2018

    Posted 02 Oct 2018 Link to this post

    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>

  2. Rumen
    Admin
    Rumen avatar
    14010 posts

    Posted 03 Oct 2018 Link to this post

    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.
  3. negar
    negar avatar
    7 posts
    Member since:
    Aug 2019

    Posted 14 Aug in reply to Rumen Link to this post

    Hello

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

  4. negar
    negar avatar
    7 posts
    Member since:
    Aug 2019

    Posted 14 Aug Link to this post

    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
  5. Rumen
    Admin
    Rumen avatar
    14010 posts

    Posted 15 Aug Link to this post

    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.
  6. negar
    negar avatar
    7 posts
    Member since:
    Aug 2019

    Posted 17 Aug in reply to Rumen Link to this post

    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

  7. Vessy
    Admin
    Vessy avatar
    2022 posts

    Posted 20 Aug Link to this post

    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.
Back to Top