Declined
Last Updated: 12 Nov 2024 16:02 by Michael D
Peter
Created on: 25 Oct 2019 06:48
Category: Grid
Type: Bug Report
0
If column value = "null" it is not displayed in grid
  • Create e.g. local data grid (id, name)
  • add 2 records => { id: 1, name: "null", id: 2, name: "Jack" }
  • Name column for id = 1 is empty

I have tested this on your example for local data grid. It can be applicable also for remote grid, treelist, etc.

 

Attached Files:
2 comments
Michael D
Posted on: 12 Nov 2024 16:02

Sorry to hijack this old issue...
I have just stumbled across the same problem.

I do not understand why the described behaviour should be expected/intended. "Null" is just some string and should have nothing to do with null, meaning the absence of a value. E.g. in German, "Null" also means 0, this string could be used in a lot of different contexts where it has nothing to do with the JS null keyword.
This is why, in my opinion, treating null and "null" equally is misleading at best and dangerous at worst. Instead, I would expect cells with value null to be empty, while cells with value "null" to contain "null".

ADMIN
Tsvetomir
Posted on: 31 Oct 2019 10:32

Hi Peter,

Generally, displaying nothing when the value is "null" is the desired functionality. Since the majority of the common users of the application might not completely comprehend when the null text is shown. It would be more talkative if the cell is left empty.

In other words, the described behavior is not a bug, rather, it is an intentional functionality. What I can recommend if you would like to show the null text is to utilize the template option of the grid's column:

{ field: "ProductName", template:"#=ProductName? ProductName: 'null'#"},

I hope you find this helpful.

 

Kind regards,
Tsvetomir
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.