Why the value & on focus is different?

I Don't understand 
Why this can happen, 
someone please tell me so i can fix this..
its only buggy in 2 of my column.. 

This is the value when not on focus

image2
And this is what happened when i focus to the column
image3

5 Replies

AR Arulpriya Ramalingam Syncfusion Team February 25, 2020 05:30 PM UTC

Hi Asep, 
 
Greetings from Syncfusion. 
 
We suspect that you have added the currency cell type for the specified column. If yes, we have created a simple sample to replicate the issue at our end, but the currency cell values are updated properly at our end. So, we suspect that the use case might be occurred due to some other grid settings and request you to refer the below sample. Let us know the code part that we are missing to reproduce the issue also, provide the exact scenario (the action that causes the issue), if we misunderstood the use case. 
 
 
Regards, 
Arulpriya 



AS Asep Sonjaya February 26, 2020 01:49 AM UTC

Im sorry, mine is not GridGroupControl but GridControl.. is it same?
And i use IList for the record not datatable.. is it related?
thanks for the reply sir.. 
i use querycellinfo to register they celltype

grid.QueryCellInfo += delegate (object senderGridQueryCellInfoEventArgs e)
{
     if (e.RowIndex > 0)
     {
          var invoiceDetail = _listOfDetailInvoice[e.RowIndex - 1];
          switch (e.ColIndex)
          {
               case 11: // Basic Fare
               e.Style.HorizontalAlignment = GridHorizontalAlignment.Right;
               e.Style.CellValue = NumberHelper.NumberToString(invoiceDetail.Amount);
               e.Style.CellType = GridCellTypeName.Currency;
               e.Style.CurrencyEdit.CurrencyDecimalDigits = 2;
               break;
               default:
               break;
          }
          e.Handled = true;
     }
};



AR Arulpriya Ramalingam Syncfusion Team February 26, 2020 12:05 PM UTC

Hi Asep, 
 
Thank you for the update. 
 
The binding source for the grid (DataTable or List) does not affect the behavior of the grid currency cell and we have validated the scenario at our end too. The cell value are updated properly and we suspect that the value from your NumberHelper class may return improper result when the cell is in editing mode. We suggest you to ensure that the NumberHelper returns proper result when the cell is editing by adding a conditional breakpoint. If the values are returned properly at your end, please refer to the below sample and let us know the code part that we are missing to reproduce the issue at our end. So that, we could validate further to provide a better solution at the earliest. 
 
 
Regards, 
Arulpriya 



AS Asep Sonjaya February 27, 2020 06:47 AM UTC

Thanks for the answer..
it is my numberhelper is the main reason..
it didnt need any custom formating for the currency field..


thanks a lot for the help.. 


AR Arulpriya Ramalingam Syncfusion Team February 27, 2020 11:22 AM UTC

Hi Asep, 
 
Most welcome! We are glad that the provided suggestion helped you to find the root cause of the scenario. Please get back to us, if you need any assistance. 
 
Regards, 
Arulpriya 


Loader.
Up arrow icon