This is a migrated thread and some comments may be shown as answers.

RadDataPager refresh

5 Answers 232 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Karel
Top achievements
Rank 1
Karel asked on 10 Jul 2014, 01:14 PM
Hello,

I have a view with RadGridView and RadDataPager. Grid´s source is PagedSource of data pager. Data pager is bound to IQueryable of items so Data pager manages data reading itself. Paging is working well but I don´t know how to refresh grid if user pressed a button for manual refresh. I have tried to use Grid.Rebind() but it didn' t work. Is there any method I could call to explicitly cause Data pager to reads data from database? And is there any event triggered during it? Because I would like to use busy indicator during the refresh.

Thanks,
Karel Bem

5 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 10 Jul 2014, 02:29 PM
Hi Karel,

Actually, you need to bind RadDataPager's Source property to the RadGridView.Items collection. Please check this help article for a reference.

Regards,
Yoan
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Karel
Top achievements
Rank 1
answered on 10 Jul 2014, 08:50 PM
Hi Yoan,

I changed it as you suggested but it didn't help. I am running sql profiler but I cannot see any sql command after I call Grid.Rebind() method. I will try to isolate this problem in a small solution but I don't know if it would be possible, it's quite big application and we are using many different frameworks like Caliburn, Cocktail, DevForce, EF so I don't know if this problem couldn't be caused by any of these frameworks. (because sometimes the refresh works well when I for example import some trades from a file and at the end of the import I call method for refresh. Problem is when someone from another instance of aplication creates trade and I want to see this new trade in my app too)

Thanks for any advice what could cause this bevavior.


0
Yoan
Telerik team
answered on 15 Jul 2014, 12:54 PM
Hi Karel,

Please try to create a sample runnable project which isolates the problem so we can investigate it locally and provide you with further assistance. Most of the times we do not need the whole project but just the piece of it which causes the problem. You can follow the instructions in this blog post how to isolate the problem in a sample project. 

Regards,
Yoan
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Karel
Top achievements
Rank 1
answered on 16 Jul 2014, 08:05 AM
Hi Joan,

the link doesn't work for me (page does not exist). Is it enough for you if I give you this code?:

<telerik:RadBusyIndicator IsBusy="{Binding Busy.IsBusy}">

        <Grid>

            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <telerik:RadGridView 
                    Grid.Row="0"
                    x:Name="Entities"
                    SelectedItem="{Binding SelectedEntity}"
                    RowIndicatorVisibility="Collapsed"
                    IsReadOnly="{Binding IsReadOnly}"
                    AutoGenerateColumns="False"
                    CanUserReorderColumns="True"
                    CanUserFreezeColumns="False"
                    ShowGroupPanel="False"
                    >
                
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn Header="IČO" Width="130"
                            DataMemberBinding="{Binding Ico}" />
                    <telerik:GridViewDataColumn Header="Název protistrany" Width="240" 
                            DataMemberBinding="{Binding Name}" />
                    <telerik:GridViewDataColumn Header="Město" Width="160" 
                            DataMemberBinding="{Binding City}" />
                    <telerik:GridViewDataColumn Header="Ulice" Width="160" 
                            DataMemberBinding="{Binding Street}" />
                    <telerik:GridViewDataColumn Header="Č.p." Width="60" 
                            DataMemberBinding="{Binding StreetNo}"
                            TextAlignment="Right"/>
                    <telerik:GridViewDataColumn Header="DIČ" Width="130" 
                            DataMemberBinding="{Binding Dic}" />
                    <telerik:GridViewDataColumn Header="Smlouva" Width="80" 
                            DataMemberBinding="{Binding AgreementDate}" 
                            DataFormatString="{}{0:d}" TextAlignment="Right" />
                    <telerik:GridViewDataColumn Header="PSČ" Width="50" 
                            DataMemberBinding="{Binding ZipCode}"
                            TextAlignment="Right"/>
                    <telerik:GridViewDataColumn Header="Den splatnosti faktur" Width="140" 
                            DataMemberBinding="{Binding InvoiceDueDay}"
                            TextAlignment="Right" TextWrapping="Wrap"/>
                    <telerik:GridViewComboBoxColumn 
                        Header="Šablona konfirmace" 
                        Width="150"
                        DataMemberBinding="{Binding ConfirmationType}"                        
                        ItemsSource="{Binding ConfirmationTypes}">
                        <telerik:GridViewComboBoxColumn.CellEditTemplate>
                            <DataTemplate>
                                <telerik:RadComboBox
                                    ItemsSource="{Binding Path=DataContext.ConfirmationTypes, 
                                    RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadGridView}}}"
                                    SelectedValue="{Binding ConfirmationType}"/>
                            </DataTemplate>
                        </telerik:GridViewComboBoxColumn.CellEditTemplate>
                    </telerik:GridViewComboBoxColumn>
                    <telerik:GridViewDataColumn Header="Kredit rating" Width="100" 
                            DataMemberBinding="{Binding CreditRating}"
                            TextAlignment="Right"/>
                    <telerik:GridViewDataColumn Header="Default rate" Width="100" 
                            DataMemberBinding="{Binding DefaultRate}"
                            TextAlignment="Right"/>
                    <telerik:GridViewDataColumn Header="Limit angažovanosti" Width="130" 
                            DataMemberBinding="{Binding EngageLimit}"
                            TextAlignment="Right"/>
                    <telerik:GridViewColumn Width="*" />
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>

            <telerik:RadDataPager 
                    Grid.Row="1"
                    PageSize="5000"
                    Source="{Binding Items, ElementName=Entities}"
                    IsTotalItemCountFixed="True"
                    DisplayMode="First, Last, Next, Previous, Text"
                    AutoEllipsisMode="Both"
                    Width="{Binding Path=ActualWidth, 
                        ElementName=Entities, 
                        Converter={StaticResource WidthConverter}}"
                    HorizontalAlignment="Center"
                />

        </Grid>

    </telerik:RadBusyIndicator>


0
Yoan
Telerik team
answered on 18 Jul 2014, 04:00 PM
Hello Karel,

Unfortunately, the provided code snippet does not helps us. Please try to send us a runnable project which reproduces the issue. Here is the correct link to the blog post:
http://blogs.telerik.com/blogs/posts/10-09-29/isolating-a-problem-in-a-sample-project.aspx

Regards,
Yoan
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
DataPager
Asked by
Karel
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Karel
Top achievements
Rank 1
Share this question
or