?
Solved

How to select a single row from a dataset table

Posted on 2013-06-13
3
Medium Priority
?
525 Views
Last Modified: 2013-06-14
I have a dataset table bound to a couple of text boxes.    I have a find button a a list of residents come up.  When the user double clicks the row on the grid I caputre that rows ID #.  I then want to take the dataset table I have and and go the the record of the ID.  I am using a bindingsource object, and I know I can use bs.position to get current position but how do I find the record with the ID selected and then make that the currently selected row.

thanks in advance
0
Comment
Question by:mgmhicks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 13

Expert Comment

by:Jesus Rodriguez
ID: 39245418
Why don't you bind the controls to the same bindingsource of the grid and will be easy for you.
Also, did you have a bindingnavigator or bindingsource for the textboxes or you fill the textboxes directly from your dataset on a sub??
0
 

Author Comment

by:mgmhicks
ID: 39245626
the textboxes are bound first.  I am using a bindingsource to do that so I can use bs.position + 1 and the textboxes fill with the next record.  However when the click the find button, they get a grid, bound to different source, but selects the ID.  ONce I have the ID I want to go the that record in the bs that matches the ID selected.
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 39247138
You can try 2 things

1) Use filter property and set a filter on ID. This would mean there is only one row and that will be shown
http://msdn.microsoft.com/en-us/library/system.windows.forms.bindingsource.filter.aspx

2) Set Position property to index of row in grid and see if the two match
http://msdn.microsoft.com/en-us/library/system.windows.forms.bindingsource.position.aspx
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question