﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Textbox - strange behaviour with BO left and right trim</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 16:03:21 GMT</lastBuildDate><ttl>20</ttl><item><title>Textbox - strange behaviour with BO left and right trim</title><link>http://forum.strataframe.net/FindPost17826.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;I have set all my string fields to have left and right trim in&amp;nbsp;the business object mapper. I have just noticed that if you try and enter a value such as "24 My Address" into a text box, the cursor jumps to the start each time a space is entered - it is impossible to enter a space.&lt;/P&gt;&lt;P&gt;Ideally, I am only trying to remove leading and trailing spaces rather than all spaces from the entire string.&lt;/P&gt;&lt;P&gt;Have I missed something?&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Aaron</description><pubDate>Thu, 17 Jul 2008 08:47:11 GMT</pubDate><dc:creator>Aaron Young</dc:creator></item><item><title>RE: Textbox - strange behaviour with BO left and right trim</title><link>http://forum.strataframe.net/FindPost17900.aspx</link><description>Cool :cool:</description><pubDate>Thu, 17 Jul 2008 08:47:11 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Textbox - strange behaviour with BO left and right trim</title><link>http://forum.strataframe.net/FindPost17883.aspx</link><description>That is good to know. I will subclass it and go back to my lazy way of working :)</description><pubDate>Wed, 16 Jul 2008 12:55:44 GMT</pubDate><dc:creator>Aaron Young</dc:creator></item><item><title>RE: Textbox - strange behaviour with BO left and right trim</title><link>http://forum.strataframe.net/FindPost17856.aspx</link><description>[quote]I have a sub-classed Infragistics textbox control that removes leading and trailing spaces when the control leaves focus/editing mode. I had assumed the SF text control would do the same rather than put a block on all spaces when editing.[/quote]&lt;/P&gt;&lt;P&gt;Actually an SF textbox &lt;EM&gt;&lt;U&gt;will&lt;/U&gt;&lt;/EM&gt; allow you to have spaces in the middle if you set the BindingFormat to "Text" on the textbox itself.&amp;nbsp; By default this is not set, but if you set this value to that property (which is empty by default) it should work as you are expecting.</description><pubDate>Tue, 15 Jul 2008 10:40:43 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Textbox - strange behaviour with BO left and right trim</title><link>http://forum.strataframe.net/FindPost17834.aspx</link><description>Hi Guys,&lt;/P&gt;&lt;P&gt;Thanks for the responses.&lt;/P&gt;&lt;P&gt;The problem I have is not what is written back to the database but more to do with what is returned&amp;nbsp;by a BO field when it is accessed. For example,&amp;nbsp;if you read a value from a BO field that is&amp;nbsp;20 characters long, then you will see different results depending on the trim settings:-&lt;/P&gt;&lt;P&gt;BO trim is set to left only,&amp;nbsp;myBO.Name returns&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Aaron Young&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&lt;/P&gt;&lt;P&gt;BO trim is set to both left and right, myBO.Name returns&amp;nbsp;"Aaron Young"&lt;/P&gt;&lt;P&gt;Obviously, I can use the trim command on any BO field reference but I want to be lazy and this seems like too much effort when the only problem is the textbox accepting spaces :)&lt;/P&gt;&lt;P&gt;I have a sub-classed Infragistics textbox control that removes leading and trailing spaces when the control leaves focus/editing mode. I had assumed the SF text control would do the same rather than put a block on all spaces when editing.&lt;/P&gt;&lt;P&gt;I dont want to appear fussy about this but left trim and right trim should allow spaces in the middle of your string. In the above example it would have been impossible to enter "Aaron Young" with left and right trim enabled. As I say I dont want to appear fussy about this but it would be a help if the control would allow spaces :)&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Aaron</description><pubDate>Mon, 14 Jul 2008 13:14:39 GMT</pubDate><dc:creator>Aaron Young</dc:creator></item><item><title>RE: Textbox - strange behaviour with BO left and right trim</title><link>http://forum.strataframe.net/FindPost17833.aspx</link><description>The VarChar will prevent this from needin the Trim, but you can just put "Text" without the quotes in the BindingFormat property of the textbox while using the Trim() options and it will prevent the "weirdness." :)</description><pubDate>Mon, 14 Jul 2008 10:07:43 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Textbox - strange behaviour with BO left and right trim</title><link>http://forum.strataframe.net/FindPost17830.aspx</link><description>Hello Aron, &lt;P&gt;[quote]I am hoping the left and right trim operation can be done either during the save or when the control loses focus.[/quote]&lt;/P&gt;&lt;P&gt;I would try the BeforeSave-Event of the BO. Something like: 'this.myBO.toTrimField.Trim();'&lt;/P&gt;&lt;P&gt;But I think Edhy is right, I never had the need to trim anything with varchar-Fields.&lt;/P&gt;&lt;P&gt;HTH, Ralph</description><pubDate>Mon, 14 Jul 2008 08:05:07 GMT</pubDate><dc:creator>Ralph Rutschmann</dc:creator></item><item><title>RE: Textbox - strange behaviour with BO left and right trim</title><link>http://forum.strataframe.net/FindPost17829.aspx</link><description>[quote]I believe that if you are using a varchar field type, the spaces will be trimmed when saved to the database.[/quote]&lt;/P&gt;&lt;P&gt;Hi Edhy,&lt;/P&gt;&lt;P&gt;I am using varchars and the textbox control simply stops spaces from being entered - it happens as soon as the space key is pressed (long before the database save). If I set the trim operation to left only, the control allows spaces but when set to left and right no spaces can be entered.&lt;/P&gt;&lt;P&gt;I am hoping the left and right trim operation can be done either during the save or when the control loses focus.&lt;/P&gt;&lt;P&gt;Aaron</description><pubDate>Mon, 14 Jul 2008 03:38:07 GMT</pubDate><dc:creator>Aaron Young</dc:creator></item><item><title>RE: Textbox - strange behaviour with BO left and right trim</title><link>http://forum.strataframe.net/FindPost17828.aspx</link><description>[quote]Ideally, I am only trying to remove leading and trailing spaces rather than all spaces from the entire string.&lt;P&gt;Have I missed something?[/quote]&lt;/P&gt;&lt;P&gt;Hi Aaron,&lt;P&gt;I believe that if you are using a varchar field type, the spaces will be trimmed when saved to the database.</description><pubDate>Sun, 13 Jul 2008 19:55:27 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item></channel></rss>