views:

27

answers:

0

Actually the problem arises only when the second string terminates with a period or parenthesis. It might involve other characters, but none of my sample data uses other punctuation.

Here's the background. The app consists of two vertical scroll viewers. On the right are search criteria, on the left a variety of detail lists and fields. The user enters text in search textboxes to find companies (or products or vendors) by names (start with and/or contains). These textboxes populate lists of companies, products and vendors in the search pane, which the customer can then scroll to populate the lists and fields in the detail pane.

At the top of the detail pane is a text block that serves as a header showing the user's search key.

Here's the code for the header block

if (lstCustomerNames0.SelectedItems[0] != null)
        {
          custHeader hdr = (custHeader)lstCustomerNames0.SelectedItems[0];
          detailHeader.Text = "Viewing " + hdr.custName.ToString ();
        }

When the customer name is ABC Company, the header reads "Viewing ABC Company".

When the customer's name is ABC Co., the header reads ".Viewing ABC Co".

Similarly, but more bizarrely is a customer name like "ABC (formerly XYZ)" which is displayed as "(Viewing ABC (formerly XYZ".

The visualizer displays the concatenation correctly, so I played with the wrap settings for the textblock, but nothing changed.

For what it's worth, here's the XAML code for the textblock:

                <TextBlock x:Name="detailHeader"
                           Foreground="White" 
                           Background="Transparent" 
                           FontWeight="Bold" 
                           FontSize="14" 
                           TextAlignment="Center" />

Anybody seen this before and workd a way out of it?