Telerik Forums
UI for Silverlight Forum
5 answers
172 views
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
Vladimir Stoyanov
Telerik team
 answered on 11 Dec 2018
12 answers
281 views
Hello 
I am using telerik rad controls for developing a silverlight 4 application. I am working on some thing like this, when a user edits a cell in radgridview and try to go to next page without saving the edited item (fig pagerintial.png), I am poping up a  warning msg saying that, "Ok"  buttonto cancel edited items and go to next page or "Cancel" button to stay on the current page(fig pagerwarningmsg.png).

I have a problem when hitting "Cancel" button, I am staying on the current page which is fine, but the raddatapager is displaying the new page index(fig pagererror.png).can anyone help me out with this issue, please refer the images and code below.

<telerik:RadDataPager x:Name="OrderPager"
                                        Grid.Row="2"
                                        Grid.Column="0"
                                        Source="{Binding PagedCollectionView, Source={StaticResource PFOViewModel}}"
                                        IsTotalItemCountFixed="False"
                                        DisplayMode="FirstLastPreviousNextNumeric, Text"
                                        telerik:StyleManager.Theme="Summer"
                                        PageIndexChanging="OrderPager_PageIndexChanging" PageSize="{Binding PageSize}" 
                                        PageIndexChanged="OrderPager_PageIndexChanged" 
                                        NumericButtonCount="10" />
 
private void OrderPager_PageIndexChanging(object sender, Telerik.Windows.Controls.PageIndexChangingEventArgs e)
      {
          // We set this to true, that way the load method knows to keep our selections.
          // If this wasn't set then we would think it is a new set of filters so we should clear the selections
          pfoViewModel.IsPaging = true;
      }

 
private void OrderPager_PageIndexChanged(object sender, PageIndexChangedEventArgs e)
        {
            if (IsDirty == true && addedItems != null)
            {
                TextBlock tb = new TextBlock();
                tb.TextWrapping = TextWrapping.Wrap;
                tb.Height = 100;
                tb.Width = 250;
                tb.Text = ApplicationStrings.SaveDatatMsg;
                tb.FontSize = 12;
                tb.FontFamily = new System.Windows.Media.FontFamily("Verdana");
 
                //Pop Up Dialog
                Telerik.Windows.Controls.DialogParameters parameters = new Telerik.Windows.Controls.DialogParameters();
                parameters.Header = ApplicationStrings.SaveDataWarningCaption;
                parameters.Content = tb;
                parameters.Theme = new Telerik.Windows.Controls.SummerTheme();
                parameters.OkButtonContent = ApplicationStrings.OKButton;
                parameters.CancelButtonContent = ApplicationStrings.CancelButton;
 
                parameters.Closed = (sender1, e1) =>
                {
                    IsDirty = false;
                    if (e1.DialogResult != null && e1.DialogResult.Value == true)
                    {
                        pfoViewModel.RejectChanges();
                        grdProducts.CancelEdit();
                        addedItems.Clear();
                        //Perform the Paging Operation
                        pfoViewModel.Page = e.NewPageIndex;
                    }
                    else
                    {
                        pfoViewModel.IsPaging = false;
                        pfoViewModel.Page = e.OldPageIndex;
                    }
                };
 
                Telerik.Windows.Controls.RadWindow.Confirm(parameters);
            }
            else
            {
            // Change the data to the next page of data...
            pfoViewModel.Page = e.NewPageIndex;
            // pfoViewModel.IsPaging = false;
            }
        }
  
 public int Page
        {
            get { return pageCurrent; }
            set
            {
                if (pageCurrent == value)
                    return;
 
                pageCurrent = value;
                RaisePropertyChanged("Page");
                // Re-load...
                RefreshRecords();
            }
        }
        private int pageCurrent = 0;  // Default
Yoan
Telerik team
 answered on 19 Mar 2018
5 answers
77 views
I'm running into some odd behavior when the number of Numeric Buttons is small.  I was able to reproduce them on the Data Pager demo at:  http://demos.telerik.com/silverlight/#DataPager/FirstLook

First Issue:

  1. Start on the first page and set the number of buttons to 3
  2. The buttons will be [1] [2] [...].
  3. If you click [...] it will go to page 3 (as expected)
  4. If you click [...] again it will incorrectly skip to page 5 (instead of going to page 4)
  5. Each time you click it, it will skip ahead two pages.
  6. If you click the left [...] to go down, it correctly goes down one page at a time (no skipping)

Second Issue:

  1. Start on the first page and set the number of button to 2
  2. The buttons will be [1] [...]
  3. Click on the [...] and it will go to page 2 as expected but the buttons don't change and neither of them are highlighted.
  4. Clicking [...] again doesn't do anything.
  5. If you skip ahead using the Next Page button, the buttons will look like [...] [...] and they behave as expected (the left [...] goes down one page and the right [...] goes up one page).

I know these might not seem like very common scenarios but it would be nice to get them fixed.

Thanks,
-Stephen
Ivan Ivanov
Telerik team
 answered on 04 Dec 2017
5 answers
86 views
I've got an otherwise working RadGridView being successfully paged (client-side) with the RadDataPager. I'm unclear what the expected behavior for a column aggregate function should be in this scenario, but what I'm getting has me a little stumped.

When the grid initially loads, the result of the CountFunction gives me the number of items on the current page, 10 in my current setup. Once I advance to the next page, the total is updated to reflect the count of the entire collection, in this case 100. At that point, I can change pages all day and it continues to show the full amount (100).

Is this the expected behavior or have I messed something up. I assume it has to do with the collection being enumerated differently on page change than when initially loaded. I'd actually prefer it gave me counts/sums from the entire collection rather than just the current page, but right now I'd just be happy with it consistently doing one or the other.

Any insight would be appreciated. I know I can just use a regular footer and calculate the values on my own, but it feels like the aggregates are almost trying to do what I want, so figured I'd run that down first.

Thank you.

Ahmed
Top achievements
Rank 1
 answered on 17 Aug 2017
1 answer
21 views

Hi,

I am using RadDataPager along with RadGridView. Specified all the values correctly. But the datapager is remaining un-clickable / un-assessable.

<telerik:RadDataPager Margin="5,5,5,5" x:Name="radGridView1" PageSize="{Binding PageSize, Mode=OneWay}" IsEnabled="True"
FontSize="10" BorderThickness="1,1,1,1" Source="{Binding Items, ElementName=radGridView1}" DisplayMode="All"
AutoEllipsisMode="Both" NumericButtonCount="5" IsTotalItemCountFixed="False" VerticalAlignment="Bottom"
HorizontalAlignment="Left" telerik:StyleManager.Theme="Windows7" />

Please response.

Regards,

Saibal

Dinko | Tech Support Engineer
Telerik team
 answered on 28 Jun 2017
2 answers
159 views
Hi,

I am using the RadDataPager control in a grid manually without setting a PagedSource or a Source. I have a ViewModel Command connected to the PageIndexChange using a behavior I created and it works fine, but in the code-behind of my view I set the PageIndex of the control to 0 sometimes. This doesn't trigger the event, and in another thread it was said that this was by design, that only when the PageIndex is changed by the control itself it triggers.

What I would expect though would be the event being called when the PageIndex is changed, whoever changed it. How could I get my Command to be called when I set the PageIndex myself without breaking the MVVM pattern? What I want to avoid is this in the code-behind of my view but it's the only thing I can think of to do what I want :

public void ResetDataPager()
{
    if (DataPager.PageIndex > 0)
    {
        DataPager.PageIndex = 0;
        // not MVVM
        var vm = (MyViewModel)DataPager.DataContext;
        vm.ChangePageIndex.Execute(DataPager.PageIndex);
    }
}

Do you have any idea how I can achieve this?
BHARATH
Top achievements
Rank 1
 answered on 08 Mar 2017
4 answers
230 views
Hi,

I would like to display a message in the RadDataPager that informs the user of the number of items in the pager. Can you guide me to how I could do this. I have attached a screenshot with a sample message to this ticket.

Any assistance would be greatly appreciated.

Regards,
Ivan.
Yoan
Telerik team
 answered on 16 Nov 2015
3 answers
92 views

Good morning,

I have some problems with this combination,

The RadGridView has filtering. The itemsource of RadGridView and RadDataPager is a PagedCollectionView list.

When no filter is applied I get X pages, and I see ​20 items on Page 1. When I apply a certain filter in the RadGridView, I now see 5 items on Page 1, and the RadDataPager still tells me there are X pages. In addition, per page, I'm see seeing only the filters of current page and not all collection.

It doesn't happen when the collection is a ObservableCollection for example.I have some problems with this combination,

The RadGridView have enable the filtering.

The itemsource of RadGridView and RadDataPager is a PagedCollectionView list.

When no filter is applied I get X pages, and I see ​20 items on Page 1. When I apply a certain filter in the RadGridView, I now see 5 items on Page 1, and the RadDataPager still tells me there are X pages. In addition, per page, I'm see seeing only the filters and not all collection of filter.

It doesn't happen when the collection is a ObservableCollection for example.

 

Petya
Telerik team
 answered on 08 Sep 2015
10 answers
81 views

I have GridView and DataPager, both have source of QueryableDataServiceCollectionView:

var ctx = new MyContext();
 
var query = (DataServiceQuery<ArtiklSifarnik>)ctx.ArtiklSifarnik.OrderBy(x => x.Sifra);
 
var view = new QueryableDataServiceCollectionView<ArtiklSifarnik>(ctx, query);
             
view.PropertyChanged += OnPropertyChanged;
view.LoadedData += OnLoadedData;
 
view.PageSize = 100;
view.AutoLoad = true;
 
gridView.ItemsSource = view;
pager.Source = view;

 

On selecting grid row and removing one item on button click GridView is refreshed but my DataPager is blocked:

view.Remove(gridView.SelectedItem as ArtiklSifarnik);

 

What am I missing?

Thanks

Dimitrina
Telerik team
 answered on 30 Jul 2015
5 answers
59 views

Hi,

 
I'm using RadDataPager with RadGridView. I need to access sorted source in RadDataPager after click on column header of my RadGridView.

Below is my code:

 
<telerik:RadGridView ItemsSource="{Binding PagedSource, ElementName=pager}" CanUserSortColumns="True" AutoGenerateColumns="True" />

<telerik:RadDataPager x:Name="pager" PageSize="25" Source="{Binding RecordsItemsSource}"
 IsTotalItemCountFixed="False"
 DisplayMode="All"
 NumericButtonCount="10" />

 
Where RecordsItemsSource is ObservableCollection in my ViewModel.

Thanks in advance,
Kris

Dimitrina
Telerik team
 answered on 27 Jul 2015
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?