how to batch edit decimal in grid

Toolbar="@(new List() { "Cancel", "Update", "Save" })">
public IEditorSettings PriceEditParams = new NumericEditCellParams
{
Params = new NumericTextBoxModel() { Min = 0, ShowSpinButton = false, Decimals = 3, Format = "n"}
};
hello, I am not able to enter decimal number in batch edit mode for the Price column in above grid , please tell me how to enter decimal number while batch editing grid?

3 Replies 1 reply marked as answer

VN Vignesh Natarajan Syncfusion Team August 6, 2020 04:42 AM UTC

Hi Aleqsandre,  
 
Greetings from Syncfusion support.  
 
Query: “ I am not able to enter decimal number in batch edit mode for the Price column in above grid  
 
We have analyzed the reported query with provided code example and found that EditorSettings is not properly defined for NumericTextBox Column. We have modified the provided code example and ensured the reported issue with batch editing. We are able to enter decimals using (.) operator and save the changes in Grid properly.  
 
Refer the below code example.  
 
<SfGrid DataSource="@OrderData" Toolbar=@ToolbarItems> 
    <GridEditSettings AllowEditing="true" AllowAdding="true" Mode="EditMode.Batch" AllowDeleting="true"></GridEditSettings> 
    <GridColumns> 
        <GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" IsPrimaryKey="true" TextAlign="TextAlign.Center" Width="120"></GridColumn> 
        <GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer ID" TextAlign="TextAlign.Center" Width="130"></GridColumn> 
        <GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="n3" EditType="EditType.NumericEdit" EditorSettings="@PriceEditParams" TextAlign="TextAlign.Center" Width="130"></GridColumn> 
        <GridColumn Field=@nameof(Order.ShipName) HeaderText="Ship Name" TextAlign="TextAlign.Center" EditType="EditType.DropDownEdit" Width="120"></GridColumn> 
        <GridColumn Field=@nameof(Order.Verified) HeaderText="Verified" EditType="EditType.BooleanEdit" TextAlign="TextAlign.Center" DisplayAsCheckBox="true" Width="120"></GridColumn> 
    </GridColumns> 
</SfGrid> 
  
@code{ 
    public string[] ToolbarItems = new string[] { "Add""Edit""Delete""Update""Cancel" }; 
  
    public IEditorSettings PriceEditParams = new NumericEditCellParams 
    { 
        Params = new NumericTextBoxModel<object>() { Min = 0, ShowSpinButton = false, Decimals = 3,Format = "n3" ,ValidateDecimalOnType = true } 
    }; 
 
      
Kindly download the sample which we have prepared from below  
 
 
Refer our UG documentation for your reference 
 
 
Kindly get back to us with more details if you are still facing the issue.  
 
Regards, 
Vignesh Natarajan 


Marked as answer

AL Aleqsandre August 7, 2020 05:10 AM UTC


thank you for support.


VN Vignesh Natarajan Syncfusion Team August 10, 2020 04:18 AM UTC

Hi Aleqsandre,  

Thanks for the update.  

We hope you have resolved your query using our solution.  

Please get back to us if you have further queries.   

Regards, 
Vignesh Natarajan 


Loader.
Up arrow icon