I have a Radgrid and Datapager which is bound as the code below, the item source is a linq to sql class, the class is queried and the results are converted into a pivot table and both the pager and grid’s source properties are set and the grid has Aggregate Results and sort descriptors added this works well. I have a refresh button on the page but I can’t work out how to clear the pager and grid when the user clicks the button. I have tried your sample code but get errors. Could you please advise on the correct method.
<telerik:RadGridView x:Name="AgedJobsListgrid" ShowGroupPanel="False" telerik:StyleManager.Theme="Office_Black" ShowColumnFooters="True" IsScrolling="False" IsTabStop="False" RowIndicatorVisibility="Collapsed" VerticalAlignment="Stretch" DataContext="{Binding ElementName=radDataPager}" RowHeight="35" FontSize="14"></telerik:RadGridView>
<telerik:RadDataPager x:Name="radDataPager" telerik:StyleManager.Theme="Office_Black"
PageSize="10"
DisplayMode="All"
IsTotalItemCountFixed="True" Source="{Binding AgedListClass}" DataContext="{Binding ElementName=AgedJobsListgrid}" />
‘code used to clear the pager and grid which fails when setting the itemsource to nothing.
radDataPager.Source = Nothing
AgedJobsListgrid.GroupDescriptors.Clear()
AgedJobsListgrid.ItemsSource = Nothing
AgedJobsListgrid.Columns.Clear()
AgedJobsListgrid.AutoGenerateColumns = True