ItemCount binding

4 posts, 1 answers
  1. Miroslaw
    Miroslaw avatar
    2 posts
    Member since:
    Sep 2012

    Posted 04 Oct 2010 Link to this post

    Hi,

    I'm using your RadDataPager inside my custom control. I've created a class containing ItemsCount dependency property, that stores total items returned by service and I've bound it with RadDataPager.ItemCount property.

    <telerik:RadDataPager x:Name="DataPager"
        DisplayMode="FirstLastPreviousNextNumeric, Text"
        ItemCount="{Binding ItemsCount, RelativeSource={RelativeSource TemplatedParent}}"
        PageSize="10" IsTotalItemCountFixed="True" />

    It works well for first load, for instance if ItemsCount is 73 RadDataPager shows 8 pages. But when I've changed ItemsCount value to 6 the number of pages does not change.
    I've used approach similar to ObjectDataSource in ASP.NET because query that returns items collection is quite heavy, so I've decided to make SQL paging using windowed query and count all items using other query. Could you help me to solve my problem? I'm using RadControls for Silverlight Q2 2010 SP1.

    Best regards
    Mirosław Piątkowski
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 04 Oct 2010 Link to this post

    Hi Miroslaw,

    Could you please try this with the SP2 version. In case the behavior is the same, please open a separate support ticket and attach a runnable sample project the reproduces this exact behavior. Once we have the sample project we will debug it to see what is going on. It is possible that you have discovered a bug.

    We are looking forward to hearing from you.

    Greetings,
    Ross
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Miroslaw
    Miroslaw avatar
    2 posts
    Member since:
    Sep 2012

    Posted 04 Oct 2010 Link to this post

    Hi,

    Thank you for quick response. I've downloaded SP2 version, but the problem still appears. Right now, when I'm setting ItemCount property the RadDataPager shows only one page no matter what the value is. I'm sending a support ticket then.

    Best regards
    Mirosław Piątkowski
  5. Answer
    Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 05 Oct 2010 Link to this post

    Hello Miroslaw,

    Change the binding to be two-way and everything will work as expected:

    ItemCount="{Binding ItemsCount, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" 

    This is simply a workaround.

    I have logged this issue and I hope that we will be able to provide a fix so that you do not need to set a TwoWay binding.

    Here you can find the PITS Issue and follow its status: Public URL

    I hope this helps.

    Sincerely yours,
    Ross
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top