Click here to Skip to main content
15,888,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am new to WPF. I am trying to implement a Popup window in WPF which will be shown at runtime, with dynamic binding of CountryList in it. User can select one country from the list and this Window should return as selected Country as Dialog Result.

I want to know, how can i create a ListBox with paging?

If anyone can help me with this would be great with Code or any useful link.

What I have tried:

I have tried rendering ListBox with scrollbars, but not able to make it as paging.
Posted
Updated 25-Jan-17 21:19pm
Comments
[no name] 25-Jan-17 9:03am    
https://www.google.com/webhp?#q=wpf+ListBox+with+paging

1 solution

0) You don't have to return anything. Just have a property in your list item class called IsSelected, and set it to true when a selection is made in the bound listbox.

1) The ListBox control allows you to page by clicking the scrollbar arrows. I don't understand why you feel that you need a custom control for this.

2) There are fewer than 200 countries in the world. Why are you concerned with paging with that few entries. What you SHOULD have is a search textbox that performs custom processing to select the country that starts with characters as they are entered by the user in the textbox.
 
Share this answer
 
v2
Comments
Robin Purbia 26-Jan-17 3:17am    
0. Noted.
1. Customer control because, that Custom Control I'll be using in other parts of Application as well.
2. Paging because, Customer needs Paging only, not scrollbars.
Robin Purbia 26-Jan-17 3:20am    
http://stackoverflow.com/questions/41848881/wpf-listbox-with-paging-style

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900