Radnumeric inside edit template issue

6 posts, 0 answers
  1. Gilberto
    Gilberto avatar
    65 posts
    Member since:
    Sep 2006

    Posted 15 Feb 2012 Link to this post

    I have a issue in this radgrid in particular at templated column with radnumericbox inside the edittemplate, currency type and culture pt-br

    The value in database is 10.00

    The label in template of related column shows R$ 10,00 (it's ok).

    When i enter in edit mode the radnumerictextbox shows R$ 1000,00 unselected and shows 1000 when got focus,  seems  it does not interprets the decimal point even when i force the numberformat properties. <NumberFormat GroupSeparator="." DecimalSeparator="," />

    Did i missed something?

    Gilberto

     
     <telerik:RadGrid ID="RadGridAnuidades" ValidationSettings-ValidationGroup="grid"
                                        runat="server" OnDataBound="RadGridAnuidades_DataBound" CellSpacing="0" GridLines="None"
                                        AllowAutomaticUpdates="True" DataSourceID="SqlDataSourceUpdateAnuidades" OnNeedDataSource="RadGridAnuidades_NeedDataSource">
                                        <ValidationSettings ValidationGroup="grid"></ValidationSettings>
                                        <MasterTableView AutoGenerateColumns="False" DataKeyNames="CódigoSócio,Ano" EditMode="InPlace"
                                            DataSourceID="SqlDataSourceUpdateAnuidades">
                                            <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                                            <Columns>
                                                <telerik:GridBoundColumn DataField="CódigoSócio" Visible="false" DataType="System.Int32"
                                                    FilterControlAltText="Filter CódigoSócio column" HeaderText="CódigoSócio" ReadOnly="True"
                                                    SortExpression="CódigoSócio" UniqueName="CódigoSócio">
                                                </telerik:GridBoundColumn>
                                               
                                                <telerik:GridTemplateColumn DataField="Valor" DataType="System.Decimal" FilterControlAltText="Filter Valor column"
                                                    HeaderText="Valor" SortExpression="Valor" UniqueName="Valor">
                                                    <EditItemTemplate>
                                                        <telerik:RadNumericTextBox ID="RadNumericTextBoxValor" runat="server" Type="Currency"
                                                            Culture="pt-BR" Text='<%# Bind("Valor") %>'>
                                                            <NumberFormat GroupSeparator="." DecimalSeparator="," />
                                                        </telerik:RadNumericTextBox>
                                                        <asp:RequiredFieldValidator ValidationGroup="grid" ID="requiredfieldvalidatorValor"
                                                            runat="server" ControlToValidate="RadNumericTextBoxValor" CssClass="failureNotification"
                                                            ErrorMessage=" *">
                                                        </asp:RequiredFieldValidator>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="ValorLabel" runat="server" Text='<%# Bind("Valor", "{0:C2}") %>'></asp:Label>
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                                                    <ItemStyle CssClass="MyImageButton" />
                                                </telerik:GridEditCommandColumn>
                                               
                                            </Columns>
                                         
                                        </MasterTableView>
                                        
                                    </telerik:RadGrid>

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 16 Feb 2012 Link to this post

    Hello Gilberto,

    Try setting KeepTrailingZerosOnFocus as true for the RadNumericTextBox.

    -Shinu.

  3. DevCraft Release
  4. Gilberto
    Gilberto avatar
    65 posts
    Member since:
    Sep 2006

    Posted 16 Feb 2012 Link to this post

    Thanks Shinu

    Unfortunately, does not works.

  5. Gilberto
    Gilberto avatar
    65 posts
    Member since:
    Sep 2006

    Posted 17 Feb 2012 Link to this post

    Usually we have decimal 18,2 to currency fields in database, but thats the trick i changed to float type in database and everyhing works fine now.

    We should have some warnings in documentation.

    Thanks

  6. Gilberto
    Gilberto avatar
    65 posts
    Member since:
    Sep 2006

    Posted 22 Feb 2012 Link to this post

    well, after i changed the database field type, edit works but insert no.

    Could someone from telerik elaborate some more about this issue? It seems to be very easy but its driving me crazy.

    Please Help

    Gilberto

  7. Gilberto
    Gilberto avatar
    65 posts
    Member since:
    Sep 2006

    Posted 23 Feb 2012 Link to this post

    Actually everything works if you bound to a DbValue property.

    Thanks

Back to Top
DevCraft Release