Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9265527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:05:24+00:00 2026-06-18T14:05:24+00:00

I am trying to create Data Form that has set of fields and paging

  • 0

I am trying to create Data Form that has set of fields and paging buttons in the bottom of the form.

I would like the Paging to be a separate control with First, Previous, Next, Last with label Item 1 of n.

This paging control will be used any data entry form to allow the user to back and forth between the previous record. For example, Orders, Invoices, Payments are the data forms. The user when he selects Orders, New Order Form is shown. It also has the paging buttons to move to the previous record.

I created a UserControl named DataPager with dependency property of PagingItems. I want this Dependency Property to be generic so that I can pass a list of items (Order, Invoice, Payment)

For this I did: List in the user control. I tried binding this in the form that needs to page.

public List<object> Items
{
    get { return (List<object>)GetValue(ItemsProperty); }
    set { SetValue(ItemsProperty, value); }
}

// Using a DependencyProperty as the backing store for Items.  This enables animation, styling, binding, etc...
public static readonly DependencyProperty ItemsProperty =
        DependencyProperty.Register("Items", typeof(List<object>), typeof(DataPager), new UIPropertyMetadata(null, LoadItems));

private static void LoadItems(DependencyObject obj, DependencyPropertyChangedEventArgs e)
{
    DataPager thisControl = (DataPager)obj;
    thisControl.RefreshItems();
}

I am getting the following error in the page where I use the control and bind:

System.Windows.Data Error: 1 : Cannot create default converter to perform 'one-way' conversions between types 'System.Collections.Generic.List`1[PagingSample.Order]' and 'System.Collections.Generic.List`1[System.Object]'. Consider using Converter property of Binding. BindingExpression:Path=Orders; DataItem='MainViewModel' (HashCode=26754911); target element is 'DataPager' (Name='dataPager1'); target property is 'Items' (type 'List`1')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='System.Collections.Generic.List`1[PagingSample.Order]' BindingExpression:Path=Orders; DataItem='MainViewModel' (HashCode=26754911); target element is 'DataPager' (Name='dataPager1'); target property is 'Items' (type 'List`1')

Not sure how I can keep the DataPager controls item property to be generic. I have not figured out yet how to tell the parent control the CurrentItem to show.

But wanted to clear the first hurdle. Any help appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T14:05:25+00:00Added an answer on June 18, 2026 at 2:05 pm

    You can’t cast List<Order> to List<object> – that’s why you’re getting this error.

    If your DataPager control only needs to control which page is displayed, and not actually modify the collection, you could simply define your Items property to be of type IEnumerable instead of List<object>, and that problem will be solved.

    This is because for any T, List<T> is castable to IEnumerable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a child form that helps the user to enter data
I am trying to create a table that has rows of data that represent
I am trying to create a report that pulls data from 2 tables: a
I'm trying to create a jboss-cache for data that is only relevant for a
I am trying to make a program that has a data grid that shows
I'm playing around with MVC3 and trying to create a simple contact form that
I am trying to create a signup form that checks if the user exists
I'm trying to create a simple crud form to insert data into a database
I'm trying to create a page that has some information in databound labels with
I'm trying to create a data extractor algoritm from group buying sites to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.