Programmatically find and set navigator

3 posts, 1 answers
  1. Victoria
    Victoria avatar
    4 posts
    Member since:
    Apr 2013

    Posted 20 Oct 2015 Link to this post

    I'm wanting to use the navigator on a stock page. We have something in the regions of 11000 stock items so I also need to offer a search function based on our part numbers. 

    After the user has found the item they want I would like them to be able to navigate either side of that item using the navigator. 

    I am using the Entity Framework and Linq to Entities. 

     I load data to the navigator with

    1.var stock = (from s in context.Stocks
    2.             select s).ToList();
    4.            this.bindingSource1.DataSource = stock;
    5.            this.bindingNavigator1.BindingSource = bindingSource1;


    How can I find the position of my item and then set the binding navigator to that position?


  2. Answer
    Dimitar avatar
    2841 posts

    Posted 21 Oct 2015 Link to this post

    Hello Victoria,

    Thank you for contacting us.

    You should set the Position property of the binding source: BindingSource.Position Property (System.Windows.Forms).

    The following article shows how you can retrieve the index of a particular list item:  how to get the index of an item in the list in a single step? - Stack Overflow

    I hope this will be useful.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Victoria
    Victoria avatar
    4 posts
    Member since:
    Apr 2013

    Posted 21 Oct 2015 in reply to Dimitar Link to this post

    Thank you so much. 

    My previous google on this had sent me on a complete wild goose chase in the wrong direction. I appreciate the stack overflow link, that worked perfectly. :)

Back to Top