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

Setting property in Style

5 Answers 54 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Le_Roy
Top achievements
Rank 2
Le_Roy asked on 06 Sep 2010, 01:33 PM

Hello, dear developers!
I got question, can I set property value of DataPager in static resource?
Here's my point of view.
This one is placed in App.xaml.

<Style x:Key="DataPagerPageSize" TargetType="telerik:RadDataPager">
  <Setter Property="telerik:RadDataPager.PageSize" Value="2"/>
</Style>

And that is on the control
<telerik:RadDataPager DisplayMode="FirstLastPreviousNextNumeric" Source="{Binding Data, ElementName=dds}" Style="{StaticResource DataPagerPageSize}"/>
DataPager using binding to DomainDataSource..

This scenario is not working. So the question is HowTo?

5 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 06 Sep 2010, 02:00 PM
Hello Le_Roy,

Your style setter is wrong. Please, read this article.

I hope this helps.

Best wishes,
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
0
Le_Roy
Top achievements
Rank 2
answered on 06 Sep 2010, 03:17 PM
According to MSDN, their example
<Style TargetType="{x:Type TextBlock}">
  <Setter Property="FontFamily" Value="Segoe Black" />
  <Setter Property="HorizontalAlignment" Value="Center" />
  <Setter Property="FontSize" Value="12pt" />
  <Setter Property="Foreground" Value="#777777" />
</Style>
And mine
<Style x:Key="DataPagerPageSize" TargetType="telerik:RadDataPager">
  <Setter Property="telerik:RadDataPager.PageSize" Value="2"/>
</Style>

E.g. with RadWindow, RadComboBox such scenario works like a charm.
Perharps its related to Resharper bug, I'll try. Tx for fast reply.
0
Rossen Hristov
Telerik team
answered on 06 Sep 2010, 03:20 PM
Hello Le_Roy,

Simply leave PageSize. You do not need the rest:

<Style x:Key="DataPagerPageSize" TargetType="telerik:RadDataPager">
  <Setter Property="PageSize" Value="2"/>
</Style>

As you notice the Style carries information about the TargetType so you do not need to specify it each Setter.

Regards,
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
0
Le_Roy
Top achievements
Rank 2
answered on 07 Sep 2010, 05:41 AM
Ross, it doesnt works either..
0
Accepted
Rossen Hristov
Telerik team
answered on 07 Sep 2010, 08:01 AM
Hi Le_Roy,

Then open a separate support ticket and send us a sample project which we can debug. Thanks in advance.

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
Tags
DataPager
Asked by
Le_Roy
Top achievements
Rank 2
Answers by
Rossen Hristov
Telerik team
Le_Roy
Top achievements
Rank 2
Share this question
or