SfDataPager With UniformGrid WPF MVVM

Hello, on a itemControl i Load a UniformGrid With some  Personnalized Buttons, with a Bind on a SfDataPager like This: 
<code>
 <ItemsControl  Grid.Row="0"
                    x:Name="icontrol"
                    Background="#FF202020"
                    ItemsSource="{Binding ElementName=dataPager, Path=PagedSource}">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <UniformGrid
                                Columns="5"
                                Rows="4" />
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <local:ButtonPerso
                                Margin="4"
                                RadioButtonClick="ButtonPerso_RadioButtonClick" />
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
 <syncfusion:SfDataPager
                    x:Name="dataPager"
                    Grid.Row="0" PageSize="20"
                    Grid.Column="2"
                    Grid.ColumnSpan="3"
                    Margin="2"
                    Source="{Binding LstMaster}" />
</code>

on load it's ok, 5 buttons are loaded, but with a command i want to load others with this command:
public sub AddCommand(myObj As MyObject)
     LstMaster.add(myObj)
     MsgBox("Count:" & LstMaster.Count)
End Sub

My LstMaster Count 6 items but the UniformGrid don't show the other Button like that:  
(tested with 6 onStart and a second Row of button appear well)
Error


5 Replies

GT Gnanasownthari Thirugnanam Syncfusion Team January 15, 2018 05:08 PM UTC

Hi Solo, 
Thank you for using Syncfusion products, 
We cannot understand your requirement based on your given information so please share more and clear details about your requirement like video or screenshot that will be helpful to provide appropriate solution at the earliest. 
We have prepared the sample based on given code snippet, you can download it from below mentioned location. 
Please revert to us with above modified sample based on your application scenario. 
Regards, 
Gnanasownthari T. 



SO Solo Obx January 24, 2018 10:43 AM UTC

Hi Gnanasownthari, thanks for the reply. Based on your projet i have made some change, for my example. 
a list can be filter by "State"  

Working Well with an Datagrid coupled with my Uniform Grid, but if you put Datagrid.Visibility "Collapsed" or remove the Datagrid the uniformGrid Don't Refresh.

I just put a datagrid Hidden on my project... It's working ! 



Attachment: SfDataGridDemo_30ee628b.rar


GT Gnanasownthari Thirugnanam Syncfusion Team January 26, 2018 03:54 AM UTC

Hi Solo, 

ItemsSource of Bounded collection updated when the SfDataGrid created only. If you are setting the Visibility property as Collapsed then SfDataGrid will not be created and so ItemsControl does not refreshed (while change the bounded collection at runtime). But If you are setting the Visibility property as Hidden then ItemsControl will get refreshed because SfDataGrid is created So we recommend you to use Hidden as a solution to meet your requirement.  

Regards, 
Gnanasownthari T. 



SO Solo Obx January 26, 2018 10:35 AM UTC

Hi, I just put a datagrid "Hidden" on my project,  It's working well.  ItemsSource of Bounded collection updated.
I understand the Couple of SfDatagrid and SfDataPger, and nice job. 
Regards.






GT Gnanasownthari Thirugnanam Syncfusion Team January 29, 2018 04:30 AM UTC

Hi Solo, 
 
Thank you for your update. 
 
Please let us know if you need further assistance on this. 
 
Regards, 
Gnanasownthari T. 


Loader.
Up arrow icon