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

ClientItemTemplate - Shows Null when Attribute Value empty

1 Answer 65 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Fergal
Top achievements
Rank 1
Fergal asked on 10 Dec 2013, 10:58 AM
I have defined a ClientItemTemplate on my RadComboBox for using during LoadOnDemand, so far, this seems to be working great. However I have a value attached to the return objects as an Attribute that is sometimes empty/null. When this happens, the record in the dropdown shows "null" or "undefined" (if I don't attach the data).

I need to set up the template so that when this happens, it just shows a blank cell instead, but I can't seem to figure out how to do this.

My template looks like this:

<table>
  <tr><td>#=Attributes.DOB#</td></tr>
</table>

My Code looks like:

var dobValue = string.Empty;
item.Attributes.Add("DOB", dobValue);

1 Answer, 1 is accepted

Sort by
0
Fergal
Top achievements
Rank 1
answered on 10 Dec 2013, 02:14 PM
Never mind. I figured out the issue. My code was heading down a different branch to the one I thought.
Tags
ComboBox
Asked by
Fergal
Top achievements
Rank 1
Answers by
Fergal
Top achievements
Rank 1
Share this question
or