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

Problem with GridnumericColumn and tab key

0 Answers 68 Views
Grid
This is a migrated thread and some comments may be shown as answers.
andy
Top achievements
Rank 1
andy asked on 05 Oct 2012, 12:55 AM

I have a Radgrid with a couple of numeric columns. The grid is in multi-edit mode, and when the user hits Save button, I loop through the grid, and call GridEditableItem.ExtractValues to get the values to save back to the database.

The issue is that when a user is entering a value in the textbox (for the gridnumericcolumn) and does not tab off that textbox and hits the save button, the value does not get saved. If the user tabs off, the entered value is formatted and when the user hits Save button, value gets saved as expeced. The issue is easily reproducible. I am using Telerik v2.0.50727



The markup is:
<telerik:RadGrid Skin="Web20" ID="RadGrid1" runat="server" OnItemCreated="RadGrid1_ItemCreated"
    OnItemDataBound="RadGrid1_ItemDataBound" OnNeedDataSource="rgTasks_NeedDataSource"
    AllowMultiRowEdit="true" ShowStatusBar="false" Width="100%" GridLines="Both">
   
    <MasterTableView HierarchyDefaultExpanded="true" HierarchyLoadMode="Client" ShowFooter="false"
        ShowGroupFooter="false" ShowHeadersWhenNoRecords="false" AllowSorting="true"
        GridLines="Both" DataKeyNames="Id" Width="100%" AutoGenerateColumns="false" EditMode="InPlace"
        TableLayout="Auto" CommandItemDisplay="Top">
        <NoRecordsTemplate>
        </NoRecordsTemplate>
        <CommandItemSettings ShowAddNewRecordButton="False" ShowExportToCsvButton="True"
                    ShowExportToExcelButton="false" ShowExportToPdfButton="false" ShowExportToWordButton="false"
                    ShowRefreshButton="False"></CommandItemSettings>
        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
        </RowIndicatorColumn>
        <Columns>
            <telerik:GridBoundColumn HeaderText="Task ID" UniqueName="MyName" DataField="IdAsInt"
                ReadOnly="true">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn HeaderText="Task Name" UniqueName="Name" DataField="Name"
                ReadOnly="true" ItemStyle-Wrap="false">
                <ItemTemplate>
                    <span style='font-weight: <%# Convert.ToBoolean(Eval("IsSummary")) == true ? "bold" : "normal"%>;
                        margin-left: <%# (Convert.ToInt32(Eval("Depth")) - 1) * 10%>px'>
                        <%# Eval("Name")%>
                    </span>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
           
            <telerik:GridNumericColumn NumericType="Number" HeaderText="Estimated Cost" DataField="ForecastCostLoc"
                UniqueName="ForecastCostLoc" AllowRounding="true" DecimalDigits="0" DataFormatString="{0:#,#}">
            </telerik:GridNumericColumn>           
           
        </Columns>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
        </EditFormSettings>
        <NoRecordsTemplate>
            There are no tasks to display
        </NoRecordsTemplate>
    </MasterTableView>
<ExportSettings Csv-EncloseDataWithQuotes="true" FileName="Forecast Costs" IgnorePaging="true">
            </ExportSettings>
    <ClientSettings AllowExpandCollapse="true" />
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
</telerik:RadGrid>

<asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="Save" ValidationGroup="PRJ_WEB_PART"
                         />

No answers yet. Maybe you can help?

Tags
Grid
Asked by
andy
Top achievements
Rank 1
Share this question
or