Jump to content
Software FX Community

& in a label causes an error


duwke

Recommended Posts

Hi,

I have the following pseudocode which is throwing an error:

  string sql = "some sql";

  DataTable dt = DataLayer.GetSqlDt(sql);

  Chart1.DataSourceSettings.Fields.Add(new FieldMap("PRODUCT_FAMILY", FieldUsage.Label));

  Chart1.DataSourceSettings.Fields.Add(new FieldMap(dt.Columns[0].ColumnName, FieldUsage.Value));

  Chart1.DataSourceSettings.Fields.Add(new FieldMap(dt.Columns[1].ColumnName, FieldUsage.Value));

  Chart1.DataSource = dt;

  // The current implementation of Silverlight Writer does not support artistic borders

  Chart1.Border = new SimpleBorder();

  // Note that the Renderer has been set to Silverlight using the code below but it can

  // be also set at design-time

  Chart1.OutputWriter = new SilverlightWriter();

One of the "PRODUCT_FAMILY" rows has the following data =  <PRODUCT_FAMILY>LL & BACKHOES</PRODUCT_FAMILY>

The resulting XAML is

<TextBlock Text="LL & BACKHOES" Canvas.Left="278.7413" Canvas.Top="208.375" FontFamily="Arial" FontSize="10.66667" Foreground="#000000">

Notice that the & is no longer encoded.  This throws an error.

 

 

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...