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

Concatenate fields for textbox value

4 Answers 3812 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ryan Emptage
Top achievements
Rank 1
Ryan Emptage asked on 04 Feb 2009, 04:01 PM
When I concatenate fields for a textbox value, e.g.

=Fields.MemberTitle1 + " " + Fields.MemberTitle2 + " " + Fields.MemberTitle3 + " " + Fields.MemberTitle4

if there is no data in one of the fields then nothing displays in the textbox at all.

why?




4 Answers, 1 is accepted

Sort by
0
Ryan Emptage
Top achievements
Rank 1
answered on 04 Feb 2009, 04:09 PM
I have overcome the problem creating a User Function, BUT this seems a bit over the top just to concatenate a few fields.
1
Accepted
Steve
Telerik team
answered on 04 Feb 2009, 04:39 PM
Hello Ryan,

This is by design. When you have DBNull for one of the fields, the end result becomes undetermined and that is why we consider the whole thing as DBNull. To avoid this, you can use the IsNull built-in function e.g.:

=IsNull(Fields.MemberTitle1, "") + " " + IsNull(Fields.MemberTitle2, "") + " " + IsNull(Fields.MemberTitle3, "")

Regards,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ryan Emptage
Top achievements
Rank 1
answered on 04 Feb 2009, 04:47 PM
ahhh ok, thanks.
0
David
Top achievements
Rank 1
answered on 21 Mar 2016, 07:30 PM
Thank you this help me so much
Tags
General Discussions
Asked by
Ryan Emptage
Top achievements
Rank 1
Answers by
Ryan Emptage
Top achievements
Rank 1
Steve
Telerik team
David
Top achievements
Rank 1
Share this question
or