This is a migrated thread and some comments may be shown as answers.

Null values showing in ComboBox

1 Answer 341 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Danny
Top achievements
Rank 1
Danny asked on 08 Feb 2017, 06:16 PM

Hi,

I'm using the following template to display values in a ComboBox:

.Template("Name: <strong>#: data.FirstName # #: data.LastName #</strong> Organisation: #: data.Organisation #<br>Email: #: data.Email #, Telephone: #: data.Telephone # <br>-----------------------------")

It's working fine except that null values from the database are actually displayed as 'null' in the display. For example, Name: null null Organisation: null.

I've tried filtering the data on the server so it replaced null values with "" but that didn't seem to work.

How can I replace the text 'null' with just a blank value?

Thanks

Tim

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 10 Feb 2017, 10:36 AM
Hello Tim,

Here's a sample dojo that shows how you can use an expression in the template, check the property's value and return an empty string instead of "null".

Regards,
Ivan Danchev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
ComboBox
Asked by
Danny
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or