RadInput and rendermode lightweigth

3 posts, 0 answers
  1. Informat
    Informat avatar
    17 posts
    Member since:
    Oct 2008

    Posted 03 Mar 2015 Link to this post

    I've installed the new version of Telerik (2015 Q1) and I noticed a weird behaviour when a radnumerictextbox is nested inside a repeater.
    When the radnumerictextbox is in the header, then the width that is stated is kept no matter what rendermode. But if the radnumerictextbox is in the itemtemplate, than the width isn't preserved when used the RenderMode="Lightweight". When I don't use a rendermode or use RenderMode="Classic", then the width is preserved.
    When I checked it with Firebug in Firefox or with the developer tools in Chrome I notice that the width in the result has disappeared in with RenderMode="Lightweight".

    Does anybody know what is the cause of the problem?

    I've made a little sample code and attached and image with the result between the two.

    ASPX-page
    <div id="divProeven" runat="server">
       <div id="divGrid" runat="server" style="border: none; padding: 0px;">
          <table id="tbl2" style="width:100%; table-layout:auto; border-collapse: collapse; border-spacing: 0;">
             <asp:Repeater ID="R2" runat="server">
                <HeaderTemplate>
                   <tr id="trHeader" runat="server" valign="top">
                      <th class="rgHeader" style="width: 95px;" id="puntTitel" runat="server">header<br/>
                         <telerik:RadNumericTextBox ID="rtbPunten" runat="server" Width="50px" Type="Number" IncrementSettings-InterceptArrowKeys="false" IncrementSettings-InterceptMouseWheel="false" MinValue="0" ToolTip="standaardwaarde" Culture="nl-BE" RenderMode="Lightweight" />
                      </th>
                   </tr>
                </HeaderTemplate>
                <ItemTemplate>
                   <tr class="rgRow">
                      <td style="vertical-align: top; width: 95px;">
                         <telerik:RadNumericTextBox ID="rtbPunten" runat="server" Width="50px" Type="Number" Culture="nl-BE" EnableSingleInputRendering="false" IncrementSettings-InterceptArrowKeys="false" IncrementSettings-InterceptMouseWheel="false" MinValue="0" RenderMode="Lightweight"  DbValue='<%#Container.DataItem("count")%>'/>
                      </td>
                   </tr>
                </ItemTemplate>
                <AlternatingItemTemplate>
                   <tr class="rgAltRow">
                      <td style="vertical-align: top; width: 95px;">
                         <telerik:RadNumericTextBox ID="rtbPunten" runat="server" Width="50px" Type="Number" Culture="nl-BE" EnableSingleInputRendering="false" IncrementSettings-InterceptArrowKeys="false" IncrementSettings-InterceptMouseWheel="false" MinValue="0" RenderMode="Lightweight" DbValue='<%#Container.DataItem("count")%>'/>
                      </td>
                   </tr>
                </AlternatingItemTemplate>
             </asp:Repeater>
          </table>
       </div>
    </div>


    Code-Behind
    Protected Overrides Sub InitializePage(ByVal sender As Object, ByVal e As System.EventArgs)
       Try
          divGrid.Attributes.Add("class", "RadGrid RadGrid_MetroTouch")
          Dim dt As New DataTable
          dt.Columns.Add("count")
          For i As Integer = 0 To 7
             Dim nr As DataRow = dt.NewRow
             dt.Rows.Add(nr)
             nr("count") = i
          Next
          R2.DataSource = dt
          R2.DataBind()
       Catch fout As iUserFriendlyException
          ShowErrorMessage(fout.Message)
       Catch fout As Exception
          showException(fout)
       End Try
    End Sub
  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 04 Mar 2015 Link to this post

    Hello Nick,

    Indeed the described problem with RadNumericTextBox can be observed using the provided sample code and it is caused by the fact that EnableSingleInputRendering property is set to false. Note that Light-weight RenderMode is supported only for single input rendering which is enabled by default. Therefore in order to avoid this wrong behavior you should set EnableSingleInputRendering to true.
    <telerik:RadNumericTextBox ID="rtbPunten" runat="server" Width="50px" Type="Number" Culture="nl-BE" EnableSingleInputRendering="true" IncrementSettings-InterceptArrowKeys="false" IncrementSettings-InterceptMouseWheel="false" MinValue="0" RenderMode="Lightweight" DbValue='<%#Container.DataItem("count")%>' />

    Regards,
    Pavlina
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Informat
    Informat avatar
    17 posts
    Member since:
    Oct 2008

    Posted 05 Mar 2015 in reply to Pavlina Link to this post

    Thanks for the information. It looks now great again.
Back to Top