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

RadInput and rendermode lightweigth

2 Answers 42 Views
Input
This is a migrated thread and some comments may be shown as answers.
Informat
Top achievements
Rank 1
Informat asked on 03 Mar 2015, 01:25 PM
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 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 04 Mar 2015, 04:32 PM
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.

 
0
Informat
Top achievements
Rank 1
answered on 05 Mar 2015, 07:51 AM
Thanks for the information. It looks now great again.
Tags
Input
Asked by
Informat
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Informat
Top achievements
Rank 1
Share this question
or