Note that there are some explanatory texts on larger screens.

plurals
  1. POThe oh so awesome AG_E_PARSER_BAD_PROPERTY_VALUE
    primarykey
    data
    text
    <p>I'm trying to extend the datagridcolumn a bit so I can make column widths percentage based, rather then absolute in silverlight. This way no matter what size the grid, the columns take up a specified percentage of the grid.</p> <p>Anyway, this is my first step</p> <pre><code>public static class DataGridColumnBehaviors { public static readonly DependencyProperty WidthPercentageProperty = DependencyProperty.RegisterAttached("WidthPercentage", typeof(double?), typeof(DataGridColumnBehaviors), new PropertyMetadata(null, OnWidthPercentagePropertyChanged)); public static double? GetWidthPercentage(DependencyObject d) { return (double?)d.GetValue(WidthPercentageProperty); } public static void SetWidthPercentage(DependencyObject d, double? value) { d.SetValue(WidthPercentageProperty, value); } public static void OnWidthPercentagePropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { } } </code></pre> <p>And in the XAML I'm doing </p> <pre><code> &lt;data:DataGridTemplateColumn MinWidth="200" dataBehaviors:DataGridColumnBehaviors.WidthPercentage="5.0" Header="Name"&gt; &lt;data:DataGridTemplateColumn.CellTemplate&gt; &lt;DataTemplate&gt; &lt;TextBlock Text="{Binding Name}" /&gt; &lt;/DataTemplate&gt; &lt;/data:DataGridTemplateColumn.CellTemplate&gt; &lt;data:DataGridTemplateColumn.CellEditingTemplate&gt; &lt;DataTemplate&gt; &lt;TextBox Text="{Binding Name, Mode=TwoWay}" /&gt; &lt;/DataTemplate&gt; &lt;/data:DataGridTemplateColumn.CellEditingTemplate&gt; &lt;/data:DataGridTemplateColumn&gt; </code></pre> <p>This is producing the following message at runtime</p> <pre><code>AG_E_PARSER_BAD_PROPERTY_VALUE [Line: 85 Position: 100] </code></pre> <p>Line 85 is this: </p> <pre><code>dataBehaviors:DataGridColumnBehaviors.WidthPercentage="5.0 </code></pre> <p>Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload