I have a RadGrid with GridNumericColumn. The culture of page is "es-ES" and collate of SQL Server Database is "Modern_Spanish_CI_AI".
In Spain decimal separator is "," and group separator is ".". RadGrid use culture "es-ES" in ViewMode, but in edit mode I belive that it use default culture.
For example, in database i have stored the value "0,22" (this value is < 1 and >0, zero comma twenty two) (Sql server datatype => float, equivalent to double in .NET framework). Now:
In Spain decimal separator is "," and group separator is ".". RadGrid use culture "es-ES" in ViewMode, but in edit mode I belive that it use default culture.
For example, in database i have stored the value "0,22" (this value is < 1 and >0, zero comma twenty two) (Sql server datatype => float, equivalent to double in .NET framework). Now:
- In ViewMode: appear "0,22" (zero comma twenty two), but
- In EditMode: appear "22" (twenty two)
| <telerik:GridNumericColumnEditor ID="GridNumericColumnEditor1" runat="server"> |
| <NumericTextBox runat="server"> |
| <NumberFormat DecimalSeparator="," GroupSeparator="." /> |
| </NumericTextBox> |
| </telerik:GridNumericColumnEditor> |
| <telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" AllowMultiRowSelection="True" AllowMultiRowEdit="True" |
| Skin="Web20" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" |
| Width="99%" AllowAutomaticUpdates="True" AllowPaging="True" AutoGenerateColumns="False" GridLines="None" OnItemDataBound="RadGrid1_ItemDataBound" > |
| <PagerStyle Mode="Slider" /> |
| <ClientSettings> |
| <Selecting AllowRowSelect="True" /> |
| <ClientMessages PagerTooltipFormatString="Página: <b>{0}</b> de <b>{1}</b>" /> |
| </ClientSettings> |
| <MasterTableView CommandItemDisplay="Top" DataKeyNames="ID_MATERIAL" DataSourceID="SqlDataSource1" EditMode="InPlace"> |
| <ExpandCollapseColumn Resizable="False" Visible="False"> |
| <HeaderStyle Width="20px" /> |
| </ExpandCollapseColumn> |
| <RowIndicatorColumn Visible="False"> |
| <HeaderStyle Width="20px" /> |
| </RowIndicatorColumn> |
| <Columns> |
| .... |
| <telerik:GridNumericColumn DataType="System.Double" ColumnEditorID="GridNumericColumnEditor1" NumericType="Number" DataField="NUM_CONDUCTIVIDAD" HeaderText="Conductividad" |
| SortExpression="NUM_CONDUCTIVIDAD" UniqueName="NUM_CONDUCTIVIDAD" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="10%" > |
| </telerik:GridNumericColumn> |
| ...... |
| <telerik:GridEditCommandColumn ButtonType="ImageButton" EditText="Editar" InsertText="Insertar" UpdateText="Actualizar"> |
| <HeaderStyle Width="25px" /> |
| </telerik:GridEditCommandColumn> |
| <telerik:GridClientDeleteColumn ConfirmText="¿Está seguro?" ButtonType="ImageButton" ImageUrl="~/img/Grid/Delete.gif" Text="Delete" UniqueName="column"> |
| <HeaderStyle Width="25px" /> |
| </telerik:GridClientDeleteColumn> |
| </Columns> |
| <EditFormSettings ColumnNumber="2" CaptionDataField="DSC_MATERIAL" CaptionFormatString="Editando <strong>{0}</strong>"> |
| <FormTableItemStyle Wrap="False"></FormTableItemStyle> |
| <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle> |
| <FormMainTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="3" BackColor="White" Width="100%" /> |
| <FormTableStyle CellSpacing="0" CellPadding="2" CssClass="module" BackColor="White" /> |
| <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle> |
| <EditColumn ButtonType="ImageButton" |
| UpdateImageUrl="~\Img\Grid\Update.gif" EditImageUrl="~\Img\Grid\Edit.gif" |
| InsertImageUrl="~\Img\Grid\Insert.gif" CancelImageUrl="~\Img\Grid\Cancel.gif" |
| InsertText="Insertar" UpdateText="Actualizar" UniqueName="EditCommandColumn1" CancelText="Cancelar"> |
| </EditColumn> |
| <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle> |
| <PopUpSettings ScrollBars="None" /> |
| </EditFormSettings> |
| </MasterTableView> |
| <FilterItemStyle BackColor="Gainsboro" /> |
| </telerik:RadGrid> |
| <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:LabLATConnectionString %>" |
| DeleteCommand="DELETE FROM [MATERIAL] WHERE [ID_MATERIAL] = @original_ID_MATERIAL" |
| InsertCommand="INSERT INTO [MATERIAL] ([DSC_MATERIAL], [NUM_CONDUCTIVIDAD], [BOL_ACTIVO], [DSC_USR_UPD], [DAT_UPD]) VALUES (@DSC_MATERIAL, @NUM_CONDUCTIVIDAD, @BOL_ACTIVO, @DSC_USR_UPD, @DAT_UPD)" |
| OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT [ID_MATERIAL], [DSC_MATERIAL], [NUM_CONDUCTIVIDAD], [BOL_ACTIVO], [DSC_USR_UPD], [DAT_UPD] FROM [MATERIAL]" |
| UpdateCommand="UPDATE [MATERIAL] SET [DSC_MATERIAL] = @DSC_MATERIAL, [NUM_CONDUCTIVIDAD] = @NUM_CONDUCTIVIDAD, [BOL_ACTIVO] = @BOL_ACTIVO, [DSC_USR_UPD] = @DSC_USR_UPD, [DAT_UPD] = @DAT_UPD WHERE [ID_MATERIAL] = @original_ID_MATERIAL"> |
| <DeleteParameters> |
| <asp:Parameter Name="original_ID_MATERIAL" Type="Int32" /> |
| </DeleteParameters> |
| <UpdateParameters> |
| <asp:Parameter Name="DSC_MATERIAL" Type="String" /> |
| <asp:Parameter Name="NUM_CONDUCTIVIDAD" Type="Double"/> |
| <asp:Parameter Name="BOL_ACTIVO" Type="Boolean" /> |
| <asp:Parameter Name="DSC_USR_UPD" Type="String" /> |
| <asp:Parameter Name="DAT_UPD" Type="DateTime" /> |
| <asp:Parameter Name="original_ID_MATERIAL" Type="Int32" /> |
| </UpdateParameters> |
| <InsertParameters> |
| <asp:Parameter Name="DSC_MATERIAL" Type="String" DefaultValue="" /> |
| <asp:Parameter Name="NUM_CONDUCTIVIDAD" Type="Double" /> |
| <asp:Parameter Name="BOL_ACTIVO" Type="Boolean" /> |
| <asp:Parameter Name="DSC_USR_UPD" Type="String" /> |
| <asp:Parameter Name="DAT_UPD" Type="DateTime" /> |
| </InsertParameters> |
| </asp:SqlDataSource> |
