I'd like to clean up my XAML files, but I can't seem to get the styling right for the XamWebGrid. How would you apply the SortingSettings, PagingSettings, and SelectionSettings with all of those properties defined in the App.xaml file? I am getting an error at run-time with the definition below:
--------------------------------------------------------------------------------------
Line: 453Error: Unhandled Error in Silverlight Application Code: 4004 Category: ManagedRuntimeError Message: System.Windows.Markup.XamlParseException: Invalid attribute value SortingSettings for property Property. [Line: 33 Position: 30] at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) at MyApp.App.InitializeComponent()).
xmlns:igGrid="clr-namespace:Infragistics.Silverlight.Controls;assembly=Infragistics.Silverlight.XamWebGrid.v10.1"
...
<Style x:Key="IGridNormal" TargetType="igGrid:XamWebGrid">
<Setter.Value>
<igGrid:SortingSettings AllowMultipleColumnSorting="True" />
</Setter.Value>
</Setter>
</Style>
Thank you - I see the error of my ways! ;)
Through a style you can only set Dependency Properties, the settings objects are standard CLR properties.
If you wanted to unify the settings objects you would have to set them up as static resources and set them on the grid.
In App.xaml
<Application.Resources>
<ig:SortingSettings AllowSorting="False" x:Key="sortSettings"></ig:SortingSettings>
</Application.Resources>
In your grid:
<ig:XamGrid SortingSettings="{StaticResource sortSettings}" x:Name="grid">
</ig:XamGrid>