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?
=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
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
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.
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