Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
240
Sort/Page/Selection Style in App.xaml?
posted

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: 453
Error: 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 Property="SortingSettings">

 

 

 

 

 

<Setter.Value>

 

 

 

 

<igGrid:SortingSettings AllowMultipleColumnSorting="True" />

 

 

 

 

</Setter.Value>

 

 

 

 

</Setter>

 

 

 

 

</Style>

 

  • 21382
    Verified Answer
    posted

    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>