Request for New Feature: DefaultValue

4 posts, 0 answers
  1. Brian
    Brian avatar
    19 posts
    Member since:
    Aug 2010

    Posted 21 Jun 2011 Link to this post

    Would you guys please consider adding a new property to all controls that have a DBValue or DBSelectedValue property? The new property would be called DefaultValue. Example use case:

    We use the FormView control for the View/Insert/Edit of records. We use ObjectDataSource binding to Telerik controls inside the FormView. We pass an object (not fields) between the FormView and the ObjectDataSource. When in the insert mode, some Telerik controls such as RadDatePicker and RadNumericTextBox are bound to the object and set to null. Currently we have to set up a OnDataBinding event to set the default values for each control. It would be extremely helpful if we could just set a new property to the default value in this case.

    Edited: I did find that we could set the Value property for a RadNumericTextBox and it would work as a default value on insert; however, other controls like checkbox don't.


    <telerik:RadNumericTextBox ID="numPurchasedPrice" runat="server" Type="Currency"
    DataType="System.Decimal" MinValue="0" MaxValue="100"  DefaultValue="0"
            DbValue='<%# Bind("PurchasedPrice") %>' >
  2. Radoslav
    Radoslav avatar
    1564 posts

    Posted 24 Jun 2011 Link to this post

    Hi Brian,

    Currently we do not have plans for implementing the described functionality into our controls. However I will forward your request to our developer department for further consideration. Therefore if it appears to be a common request and attainable enhancement, you may see it included in a future version of the product.

    All the best,
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. DevCraft R3 2016 release webinar banner
  4. Curtis
    Curtis avatar
    23 posts
    Member since:
    Jan 2008

    Posted 23 Feb 2012 Link to this post

    I second this request. When binding to a NumericTextBox like the above example in a RadGrid, you get an error when you call item.UpdateValues(entity) later if you have a numeric property that doesn't allow nulls. The default value of the NumericTextBox should return 0 and not null.
  5. Radoslav
    Radoslav avatar
    1564 posts

    Posted 28 Feb 2012 Link to this post

    Hi Curtis,

    Unfortunately we do not have plans for such functionality. If we set the default value of NumericTextBox to be 0 then when you bind the NumericTextBox to a database field and this field contains NULL the exception will be thrown. If we tried to convert NULL to 0 in such cases then you could not differentiates fields into database which has 0 from these with NULL. In this case the NumericTextBox will be populated with 0.

    All the best,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top