Total count in the Pager Style

14 posts, 0 answers
  1. Alessandro
    Alessandro avatar
    12 posts
    Member since:
    Sep 2008

    Posted 14 Dec 2010 Link to this post

    Hello,
    I need to show the total items count in the datate pager. I have read the other posts about this problem and I know that I must edit the style of the data pager.

    I have created a custom style where I put a Textblock with this binding:

    <

     

     

    TextBlock Text="{Binding ItemCount, ElementName=pagerItems, Mode=TwoWay}" FontWeight="Bold"/>

     

    All works fine with one data pager.
    I have some situations where I have two grids with two datapagers in my form. So, in this situations, only one datapager can have the name "pagerItems" and so only one can show the total count of items.
    How can I modify this binding? I don't want to duplicate the style. Is it possible?

    Thanks,
    Alessandro
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 14 Dec 2010 Link to this post

    Hello Alessandro,

    When we release the Service Pack you will be able to do this in absolutely the same way as with the PageSize in your other ticket.

    But do not do it with ElementName since that makes no sense at all. When e control is inside the control template of another control, it should use TemplateBinding to bind to the properties of the "upper" control.

    Please, read this before going on.

    Best wishes,
    Ross
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. DevCraft banner
  4. Alessandro
    Alessandro avatar
    12 posts
    Member since:
    Sep 2008

    Posted 14 Dec 2010 Link to this post

    I already try with the templatebinding but I receive an error.
    When do you plan to release the service pack?

    Thanks,
    Alessandro
  5. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 14 Dec 2010 Link to this post

    Hi Alessandro,

    It is normal that you receive this error.

    By the way, our records indicate that you have never downloaded any version of RadControls for Silverlight.

    Can you explain that please?

    Kind regards,
    Ross
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  6. Alessandro
    Alessandro avatar
    12 posts
    Member since:
    Sep 2008

    Posted 14 Dec 2010 Link to this post

    For the moment we are evaluating a trial version that we receive from a Microsoft MVP. 

    We have already decided to buy the entire suite of your controls (Silverlight, ASP.NET and so on), but we are waiting the new year.
    We plan to release all our new products with a new interface based on Silverlight and Telerik controls.

    I don't know if the version that I'm using is old. I can download and use the trial version if it's better and more recent.

    Thanks,
    Alessandro

  7. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 14 Dec 2010 Link to this post

    Hi Alessandro,

    Thanks for the info. I will update our records.

    We plan to release the SP in a week or two. It is always better to use the latest version if possible.

    Kind regards,
    Ross
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  8. Alessandro
    Alessandro avatar
    12 posts
    Member since:
    Sep 2008

    Posted 14 Dec 2010 Link to this post

    Ok, thanks.
    I have checked my version and it's old, so I'll download the trial version when you'll release the next SP.

    By the way you confirm that with the next SP, I can use a binding like this:

    <

     

     

    TextBlock Text="{TemplateBinding ItemCount}" FontWeight="Bold"/>

     

    Right?

    Thanks for the great support.
    Alessandro
  9. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 14 Dec 2010 Link to this post

    Hi Alessandro,

    Assuming that these text boxes are inside the DataPagerPresenterTemplate, i.e. somewhere around the other default controls shown by the pager, here is what you should use:

    <TextBlock Text="{Binding ItemCount, RelativeSource={RelativeSource TemplatedParent}}"
    <TextBlock Text="{Binding PageSize, RelativeSource={RelativeSource TemplatedParent}}"

    As an example, here is how we are showing the PageCount right now in this template:

    <TextBlock Text="{Binding PageCount, RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="Center" Margin="2,0" />

    The same should work for the ItemCount and PageSize once we roll out the SP.

    In case there are problems once we roll out the SP -- let us know.

    Greetings,
    Ross
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  10. Alessandro
    Alessandro avatar
    12 posts
    Member since:
    Sep 2008

    Posted 23 Dec 2010 Link to this post

    Hello again,
    I'm trying the last internal build, the 00992RadControls_for_Silverlight_4_2010_3_1220_TRIAL_hotfix.
    In my style I have inserted this TextBlock:

    <

     

     

    TextBlock Text="{Binding ItemCount, RelativeSource={RelativeSource TemplatedParent}}" FontWeight="Bold"/>

     

    I don't have errors anymore but the ItemCount is always 0.
    How can I resolve the problem? Does the last internal build, fully support this property?

    Thanks,
    Alessandro
  11. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 24 Dec 2010 Link to this post

    Hi Alessandro,

    Where have you placed this? Could you please open a separate support ticket and send me your sample project. I will take a look at it to see what is wrong.

    Regards,
    Ross
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  12. Alessandro
    Alessandro avatar
    12 posts
    Member since:
    Sep 2008

    Posted 03 Jan 2011 Link to this post

    Hi,
    I don't know if I do the right thing. I have open a ticket in your public system. In that ticket I have added the sample program.
    Tell me if this is the right thing or if I must open a different ticket.

    Thanks, Alessandro
  13. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 04 Jan 2011 Link to this post

    Hi Alessandro,

    I have updated the sample project in your other ticket.

    Kind regards,
    Ross
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  14. Diego
    Diego avatar
    1 posts
    Member since:
    Nov 2010

    Posted 17 Jan 2011 Link to this post

    Hi, I've got the same situation where ItemCount is aways 0, could you please show me the solution?
  15. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 17 Jan 2011 Link to this post

    Hi Alessandro,

    You need to use the new XAML from the Latest Internal Build, since we have added something to it.

    Or simply add this after line 241, it is colored in yellow:

    <dataPager:DataPagerPresenter telerik:StyleManager.Theme="{StaticResource Theme}" NumericButtonStyle="{TemplateBinding NumericButtonStyle}"  AutoEllipsisMode="{TemplateBinding AutoEllipsisMode}"
                                  DisplayMode="{TemplateBinding DisplayMode}" PageIndex="{TemplateBinding PageIndex}" PageCount="{TemplateBinding PageCount}"  NumericButtonCount="{TemplateBinding NumericButtonCount}"
                                  Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
                                  VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                  ItemCount="{TemplateBinding ItemCount}"
                                  />

    This will provide the link between the ItemCount of the pager and the ItemCount of the pager presenter, i.e. the thing that you are bound to.

    I have attached the modified project.

    Greetings,
    Ross
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top
DevCraft banner