I'm trying to get a RadDropDownButton's Content to display a DataPager and a GridView. I have both displaying properly, and can bind to the current DataMember just fine. The pager's ItemSource binds find, and displays the proper number of pages.What I cannot do is bind the GridView's ItemSource to the DataPager's PagedSource. I have no way to specify the ItemSource binding on GridView. ElementName does not find it.
They are siblings, on the same level inside the DataTemplate.
Any ideas?
They are siblings, on the same level inside the DataTemplate.
Any ideas?
6 Answers, 1 is accepted
0
Hello Jerome,
Sincerely yours,
Milan
the Telerik team
You could try binding the grid to the data and the pager to the Items property of the grid. For example:
<
telerik:RadDataPager
PageSize
=
"100"
Source
=
"{Binding Items, ElementName=GridView}"
IsTotalItemCountFixed
=
"True"
/>
<
telerik:RadGridView
x:Name
=
"GridView"
ItemsSource
=
"{Binding MyDataSource}"
/>
Sincerely yours,
Milan
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
Jerome
Top achievements
Rank 1
answered on 25 Aug 2010, 04:18 PM
I'm not sure how that suggestion is supposed to help, on two levels. First, if the Binding on the GridView cannot find the DataPager by name, why would the binding on the DataPager be able to find the GridView by name? They're right next to each other.
Second, how is this filtering the data in the GridView? The GridView's data is coming directly from the unpaged source.
Also, it doesn't work, for reason #1.
Second, how is this filtering the data in the GridView? The GridView's data is coming directly from the unpaged source.
Also, it doesn't work, for reason #1.
0
Jerome
Top achievements
Rank 1
answered on 25 Aug 2010, 04:19 PM
I want to reiterate that this works fine when NOT inside of a RadDropDownButton's Content. Only within that DataTemplate does this problem occur.
0
Hi Jerome,
Sincerely yours,
Milan
the Telerik team
We investigated the problem and it turned out that the reason is how DataTemplate gets processed by the framework and how we respond to that processing. We will try to fix this issue as soon as possible.
For the time being you could subscribe to Loaded event of the pager and setup all properties in the event handler.
Sorry for the inconvenience.
Sincerely yours,
Milan
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
Jerome
Top achievements
Rank 1
answered on 31 Aug 2010, 04:43 PM
Thanks, Milan.
I did do how you suggested a few days ago, manually binding using Source instead of any relative method, and did solve the issue. I look forward to a fix so I can remove an ugly block of code. =)
I did do how you suggested a few days ago, manually binding using Source instead of any relative method, and did solve the issue. I look forward to a fix so I can remove an ugly block of code. =)
0
Hi Jerome,
We have fixed this issue. Now RadDataPager will be correctly initialized when inside a DataTemplate. Furthermore, the order of the properties defined in XAML will not matter, since we have added support for batch initialization.
The Latest Internal Build will be released tomorrow. Could you please test with it and let us know if there are any problems left.
Best wishes,
Ross
the Telerik team
We have fixed this issue. Now RadDataPager will be correctly initialized when inside a DataTemplate. Furthermore, the order of the properties defined in XAML will not matter, since we have added support for batch initialization.
The Latest Internal Build will be released tomorrow. Could you please test with it and let us know if there are any problems left.
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