default value

3 posts, 0 answers
  1. Kjell
    Kjell avatar
    225 posts
    Member since:
    May 2011

    Posted 15 Sep 2016 Link to this post

    I use EditItemTemplate and RadNumericTextBox.

    How set default value to 100 into the RadNumericTextBox if the user does not fill in the value?


    <telerik:GridTemplateColumn UniqueName="sortid" SortExpression="sortid" HeaderText="Sortering" EditFormHeaderTextFormat="" HeaderStyle-Width="100px">
            <asp:Label ID="lblSortid" Text='<%# Eval("sortid") %>' runat="server" />
            <telerik:RadNumericTextBox ID="tbSortid" Width="100px" MaxLength="3" Text='<%# Bind("sortid") %>' EmptyMessage="Sortering (100)" ToolTip="Sortering" runat="server">
                <NumberFormat DecimalDigits="0" GroupSeparator="" />
                ErrorMessage="Sortering (100)?"
                runat="server" />

  2. Phil H.
    Phil H. avatar
    88 posts
    Member since:
    Nov 2008

    Posted 15 Sep 2016 in reply to Kjell Link to this post


    Try onblur clientside event.  If the sender (RadNumericTextbox) get_value() is empty then set it.


  3. Viktor Tachev
    Viktor Tachev avatar
    2497 posts

    Posted 19 Sep 2016 Link to this post


    If you would like to specify a default value that will be inserted by default for the field you can use the DefaultInsertValue property for the column.

    Viktor Tachev
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top