How Allow null value in Radgrid batchedit mode

2 posts, 0 answers
  1. Boris
    Boris avatar
    18 posts
    Member since:
    Feb 2015

    Posted 23 Nov 2015 Link to this post

    When the user empties a value a numeric text box, the grid doesn't save changes and the changed field stays with a red dot in the corner.

    In this scenario I would like the row to be saved with a null value for the numeric field. Is that possible?


                GroupPanelPosition="Top" Skin="Silk"
                AllowFilteringByColumn="True" AlternatingItemStyle-Wrap="False" AlternatingItemStyle-BackColor="#B8B1B4" ItemStyle-Wrap="false"
                AllowSorting="True" Height="650px" Width="100%" AllowPaging="True" PageSize="2000" AutoGenerateDeleteColumn="True" DataSourceID="LinqYonisLogs" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true" OnBatchEditCommand="RadGrid1_BatchEditCommand">

    <AlternatingItemStyle Wrap="False" BackColor="#B8B1B4"></AlternatingItemStyle>

            <MasterTableView DataSourceID="LinqYonisLogs" CommandItemDisplay="TopAndBottom" DataKeyNames="CustomerCode, MQS_Code" EditMode="Batch">
                <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false"/>
                    <telerik:GridBoundColumn DataField="CustomerCode" ReadOnly="true" FilterControlAltText="Filter CustomerCode column" HeaderText="Customer Code" SortExpression="CustomerCode" UniqueName="CustomerCode">
                    <telerik:GridBoundColumn DataField="MQS_Code" ReadOnly="true" FilterControlWidth="55px" FilterControlAltText="Filter MQS_Code column" HeaderText="MQS Code" SortExpression="MQS_Code" UniqueName="MQS_Code">
                    <telerik:GridTemplateColumn DataField="QuotedPrice" DataType="System.Decimal" FilterControlAltText="Filter QuotedPrice column" HeaderText="Quoted Price" SortExpression="QuotedPrice" UniqueName="QuotedPrice">
                            <telerik:RadNumericTextBox ID="rdteQuotedPrice" runat="server" DbValue='<%# Eval("QuotedPrice") %>'>
                                <IncrementSettings InterceptMouseWheel="false" InterceptArrowKeys="false" />
                            <asp:Label ID="QuotedPriceLabel" runat="server" Text='<%# Eval("QuotedPrice") %>'></asp:Label>
                    <telerik:GridBoundColumn DataField="Action" FilterControlAltText="Filter Action column" HeaderText="Action" SortExpression="Action" UniqueName="Action">


    <PagerStyle AlwaysVisible="True"></PagerStyle>
            <ClientSettings EnableRowHoverStyle="True" AllowKeyboardNavigation="True">
                <KeyboardNavigationSettings AllowActiveRowCycle="True" />
                <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="false" />
                <Resizing AllowColumnResize="True" />
                <Selecting AllowRowSelect="true" />

    <ItemStyle Wrap="False"></ItemStyle>

            <PagerStyle AlwaysVisible="True" />

  2. Konstantin Dikov
    Konstantin Dikov avatar
    2466 posts

    Posted 25 Nov 2015 Link to this post

    Hello Boris,

    As you could see in the following demo, emptying the UnitsInStock field and clicking on the "Save Changes" button will pass the null value and will save it to the dabase:
    The same behavior could be observed with a template column like yours. Can you please confirm that you are clicking on the "Save Changes" button? If so, please examine your browser's console and see if there are any JavaScript errors that could break the functionality of the control.

    Best Regards,
    Konstantin Dikov
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top