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 562043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:30:48+00:00 2026-05-13T12:30:48+00:00

I have a WPF form that shows a contact (Name, Address and State). The

  • 0

I have a WPF form that shows a contact (Name, Address and State).

The GUI is bound to a CurrentContact object and they are stored in a List<Contact>.

I would like to add buttons to the bottom:

+-----+  +-----+  +-----+  +-----+ 
| <<  |  |  <  |  |  >  |  | >>  |
+-----+  +-----+  +-----+  +-----+  

Meaning first, previous, next and last.

Is there an easy control or convention to iterate through the list? Or do I need to store an currentItemIndex and roll my own?

  • 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-05-13T12:30:48+00:00Added an answer on May 13, 2026 at 12:30 pm

    Lists provide random access, so you don’t need to iterate through them to get from one spot to another. In fact, it’s probably inefficient to iterate if the list is very long; imagine you wanted to get to the last record from the first one, for example.

    In any case, your four buttons would just be:

    • first: list[0]
    • previous: list[currentIndex - 1]
    • next: list[currentIndex + 1]
    • last: list[list.Count - 1]
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WPF form that uses ClientLogin to log a user into their
I have a main wpf form that opens a new form. However when that
I'm coding a windows form using WPF, XAML, C#. I have a Frame object
I have a menu item on my WPF form that runs an import routine,
I have an object that in a simplified form is as follows: public class
I have the following datagrid in a wpf form: <DataGrid Name=DataGrid AutoGenerateColumns=False VerticalScrollBarVisibility=Auto> <DataGrid.Columns>
I've got an XML structure bound to a WPF form, and have it all
I have a WPF form with a DataGrid. This DG contains a DataGridTemplateColumn that
I have a WPF form with a ListBox of items bound to a method
In my WPF application, I have a ListView on the main form that displays

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.