Refresh/Rebind CSLADataProvider

Refresh/Rebind CSLADataProvider

Old forum URL: forums.lhotka.net/forums/t/7769.aspx


npatel posted on Monday, October 12, 2009

I am attempting to pass a static resource to the CSLADataProvider as a factoryparameter using the following piece of XAML:

<UserControl.Resources>
<Common:FormatListFilterCriteria x:Key="FormatListFilterCriteriaObject" />

<csla:CslaDataProvider x:Key="FormatListProvider"
                               ObjectType="{x:Type Common:FormatList}"
                               FactoryMethod="GetFormatList"
                               IsAsynchronous="True"
                               DataChangedHandler="{StaticResource errDialog}"
                               IsInitialLoadEnabled="True" >
            <csla:CslaDataProvider.FactoryParameters>
                <StaticResource ResourceKey="FormatListFilterCriteriaObject" />
            </csla:CslaDataProvider.FactoryParameters>
        </csla:CslaDataProvider>
</UserControl.Resources>

I am using the Infragistics XamComboEditor to populate my FilterCriteria object in the following code:

<Grid DataContext="{StaticResource FormatListFilterCriteriaObject}">
<igEditor:XamComboEditor Name="cboItem"
                                             Grid.Column="1"
                                             Grid.Row="1"
                                             Theme="Office2k7Blue"
                                             Value="{Binding Path=ItemKey, BindsDirectlyToSource=True }" 
                                             HorizontalAlignment="Left"
                                             Height="21"
                                             VerticalAlignment="Top"
                                             Width="150"
                                             IsEditable="True">
                        <igEditor:XamComboEditor.ItemsProvider>
                             ...
                        </igEditor:XamComboEditor.ItemsProvider>
</igEditor:XamComboEditor>
</Grid>

The issue that I am having is that the FilterCriteria object has the correct property set, and looking at the data provider's FactoryParameter collection in debug, the correct data is set.  But, my Data property collection of the data provider is not refreshing.  At first thought, I thought that maybe by adding a .Refresh() or .ReBind() would force the dataprovider to refresh, but it didn't help.  Any thoughts?

Peer replied on Thursday, February 18, 2010

Hi nPatel,

I had (have) exacly the same problem, I solved it by adding parameters to my factorymethod on the client object and  defining corresponding Factoryparameters in the dataprovider. This is only half the solution, I  still have to make those factoryparameters dynamic.

There is a new thread concerning this issue:

http://forums.lhotka.net/forums/t/8543.aspx

Peer

Copyright (c) Marimer LLC