This question is locked. New answers and comments are not allowed.
Alessandro
Top achievements
Rank 1
Alessandro
asked on 14 Dec 2010, 11:56 AM
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:
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
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
13 Answers, 1 is accepted
0
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
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
0
Alessandro
Top achievements
Rank 1
answered on 14 Dec 2010, 02:02 PM
I already try with the templatebinding but I receive an error.
When do you plan to release the service pack?
Thanks,
Alessandro
When do you plan to release the service pack?
Thanks,
Alessandro
0
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
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
0
Alessandro
Top achievements
Rank 1
answered on 14 Dec 2010, 02:14 PM
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
0
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
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
0
Alessandro
Top achievements
Rank 1
answered on 14 Dec 2010, 02:21 PM
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:
Thanks for the great support.
Alessandro
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
0
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
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
0
Alessandro
Top achievements
Rank 1
answered on 23 Dec 2010, 02:04 PM
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:
How can I resolve the problem? Does the last internal build, fully support this property?
Thanks,
Alessandro
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
0
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
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
0
Alessandro
Top achievements
Rank 1
answered on 03 Jan 2011, 03:20 PM
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
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
0
Hi Alessandro,
I have updated the sample project in your other ticket.
Kind regards,
Ross
the Telerik team
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
0
Diego
Top achievements
Rank 1
answered on 17 Jan 2011, 01:18 PM
Hi, I've got the same situation where ItemCount is aways 0, could you please show me the solution?
0
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:
Greetings,
Ross
the Telerik team
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>>