Hello support,
ASPxTokenBox saves text value instead of integer when the text value contains a space (two words or more).
Related support ticket T209510 claims there is a solution from 15.1.3 and beyond but I'm able to reproduce the bug every time.
Here is what my HTML looks like:
<dx:ASPxTokenBox Width="600px" ID="Cats" runat="server" DataSourceID="dsCategories" ValueSeparator="," TextField="Category" ValueField="LiveCourseCategoryId" AllowCustomTokens="False" ShowShadow="True" />
When saving to my database my column looks like:
1,2,5,Vestibular and Balance, 4,hokey pokey, 7, etc…
This is fairly critical, please help!
Thank you,
Nick
Hello Nick,
I tested the project from the T209510: ASPxTokenBox has incorrect values if TextField contains several spaces ticket in the 15.1.6 version, but did not succeed in reproducing the issue (see the attached screencast). Would you please clarify whether your scenario is different and modify the project accordingly to demonstrate the issue?
I'm looking forward to your reply.
Found the problem. Your token box does not like \r or \n (possibly other special characters).
Take your example and change a user to: new User {UserID = 2, UserName = "Vestibular\r\n&\r\nBalance"},
I solved it by cleaning up the SQL data but now you know stripping out those special characters fixed the problem. I'm sure there are other special characters that might be throwing things off too. It was hard to track down because when I look at the Item collection of the token box, the value was numeric.
So I suspect that TokenBox.Value.ToString() has the bug in it.
Hope that helps!
Nick
Hi Nick,
Thank you for the additional information. I managed to reproduce the issue with the \r character. So, I forwarded this ticket to our developers for further research. We will contact you as soon as we have any results.