Jump to content
Software FX Community

& in a label causes an error


Recommended Posts


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


This topic is now archived and is closed to further replies.

  • Create New...