7 Answers, 1 is accepted
I will prepare a sample project for you, but let me make sure that I understand the requirements.
You want the domain data source to move to page x the first time ever it loads data from the server. From then on it will respond to user input normally, i.e. this will be a single operation only the first time. In case I am missing something, now is the time to explain your exact requirements and I will do my best to prepare a sample project.
Thanks in advance.
Ross
the Telerik team
Please see the attached project. You should use a Dispatcher.
I hope this helps.
Ross
the Telerik team
Thanks
Can you take a look at the sample project I have attached. I have used a Dispatcher and everything worked correctly.
I hope this helps.
Ross
the Telerik team
Private
Sub View_immobiliDomainDataSource_LoadedData(ByVal sender As System.Object, ByVal e As Telerik.Windows.Controls.DomainServices.LoadedDataEventArgs)
If DataPager1.PageIndex = -1 Then
Me.Dispatcher.BeginInvoke(Function() DataPager1.PageIndex = 3)
End If
...
I am not a VB specialist, but the code seems okay to me. Is it actually executed? Can you use the debugger? Does the debugger reach the code I suggested? Does it go inside the if?
You can add a boolean flag that will tell you whether you have performed this one-time operation and perform it according to this boolean flag instead of relying on the fact that PageIndex is -1, since I really don't know what you are doing in your project. Obviously, you are doing something different than my sample project, but you are the only one that knows what is it, since you now have both projects.
What is the difference between my sample project and yours?
Can you send me a dummy version of your project but only with the relevant stuff concerning this issue. In other words, I don't need your entire project with all kinds of other stuff but a dummy version of it that demonstrates what you are doing. I also need to be able to compile and run it without problems. In this way I will be able to debug it and see what is going on.
Thanks in advance.
Ross
the Telerik team
Private Sub View_immobiliDomainDataSource_LoadedData(ByVal sender As System.Object, ByVal e As Telerik.Windows.Controls.DomainServices.LoadedDataEventArgs)
If DataPager1.PageIndex = -1 Then
Me.Dispatcher.BeginInvoke(AddressOf ChangePage)
End If
...
End Sub
Private Sub ChangePage()
Me.DataPager1.PageIndex = 2
End Sub