This is a migrated thread and some comments may be shown as answers.

Programmatically find and set navigator

2 Answers 320 Views
BindingNavigator
This is a migrated thread and some comments may be shown as answers.
Victoria
Top achievements
Rank 1
Victoria asked on 21 Oct 2015, 03:14 AM

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();
3. 
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?

Thanks, 
Victoria

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 21 Oct 2015, 11:40 AM
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.

Regards,
Dimitar
Telerik
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
0
Victoria
Top achievements
Rank 1
answered on 22 Oct 2015, 02:12 AM

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. :)

Tags
BindingNavigator
Asked by
Victoria
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Victoria
Top achievements
Rank 1
Share this question
or