Results 1 to 6 of 6

Thread: [RESOLVED] WPF: Binding to IEnumerator?

  1. #1

    Thread Starter
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Resolved [RESOLVED] WPF: Binding to IEnumerator?

    I have two buttons, (next button and previous button) that moves to the next or previous record, I am using IEnumerator for this and added the MovePrevious method. Upon moving records, I am manually populating the data of this FlowDocumentPageViewer. I am thinking, is there a way that I can just bind the FlowDocumentPageViewer to a collection or something so that when I traverse records then it will automatically reflected in the viewer?

    Thanks!
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,297

    Re: WPF: Binding to IEnumerator?

    You should probably be using some class derived from CollectionView, e.g. ListCollectionView for IList data sources. You bind your list to it and bind it to your controls and it provides the navigation. I've not used WPF much so I don't know all the details but I believe that you can use a CollectionViewSource in XAML.

  3. #3
    Frenzied Member Lightning's Avatar
    Join Date
    Oct 2002
    Location
    Eygelshoven
    Posts
    1,611

    Re: WPF: Binding to IEnumerator?

    You could put all record in an (invisible) listview and bind the FlowDocumentPageViewer to the selectedItem property
    VB6 & C# (WCF LINQ) mostly


    If you need help with a WPF/WCF question post in the NEW WPF & WCF forum and we will try help the best we can

    My site

    My blog, couding troubles and solutions

    Free online tools

  4. #4

    Thread Starter
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: WPF: Binding to IEnumerator?

    Quote Originally Posted by Lightning View Post
    You could put all record in an (invisible) listview and bind the FlowDocumentPageViewer to the selectedItem property
    Somehow I've considered doing that but I thought it maybe ugly. Looking at CollectionView for now, I hope it will work in my case.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,297

    Re: WPF: Binding to IEnumerator?

    Quote Originally Posted by Lightning View Post
    You could put all record in an (invisible) listview and bind the FlowDocumentPageViewer to the selectedItem property
    That would be a complete hack and a horrible solution. Controls are for user interaction and that is all they should be used for.

  6. #6

    Thread Starter
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: [RESOLVED] WPF: Binding to IEnumerator?

    CollectionView worked.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width