Hi Ricktor,
If the targeted functionality is to not display the negative values in a given currency column, this functionality can be implemented using the following approach.
First, we have to define a column template as follows:
field: "UnitPrice", title: "Unit Price", format: "{0:c}", width: "120px", template: '#=getPrice(data)#' }
The second step is to define the function that will return the correct Grid template. Here is the function I can suggest. The same can be implemented using a ternary operator.
function getPrice(data){
if(data.UnitPrice < 0) {
return '';
}
else return data.UnitPrice
}
The marked 'UnitPrice' field should be changed with the corresponding field in the context of your application.
Here is a Dojo example demonstrating the usage of the above code. Set negative values in the UnitPrice fields inside the Grid and see that the negative values will not appear.
Regards,
Petar
Progress Telerik
Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).