473,657 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

BindingManagerB ase.Position and Table.Rows.Find

How do I retrieve the position value after successfully finding the row that
I'm looking for? I need to set

BindingManagerB ase.Position

so that all of the controls on the form are synchronized. Is there another
way of moving to a particular record within a dataset given the value of the
key?

Nov 17 '05 #1
4 6262
Christopher,

Because this is a base class is this not the way to go.

Have a look at this page, there is a lot of explanation too.
Currencymanager

http://msdn.microsoft.com/library/de...classtopic.asp

I hope this helps,

Cor
Nov 17 '05 #2
Hi Christopher,

As you use complex data binding, do the following:

CurrencyManager cm = (CurrencyManage r)this.BindingC ontext[theDataTable];
DataView dv = (DataView)cm.Li st;

// Search the row in the DataView by its key.
// We need the index of the row in the DataView, not the source DataTable.

cm.Position = foundRowIndex;

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"Christophe r Weaver" <we*****@verizo n.net> wrote in message
news:OQ******** ******@TK2MSFTN GP09.phx.gbl...
How do I retrieve the position value after successfully finding the row
that I'm looking for? I need to set

BindingManagerB ase.Position

so that all of the controls on the form are synchronized. Is there
another way of moving to a particular record within a dataset given the
value of the key?


Nov 17 '05 #3
Here's what I've tried so far:

The declaration in the form's class definition:
private CurrencyManager ByNames_cMgr;

In the form constructor:
ByNames_cMgr = (CurrencyManage r)this.BindingC ontext[dsAssignedBy1,
"Table"];

In the DropDown event handler for the ComboBox:

ComboBox cb = (ComboBox)sende r;
DataTable dt = (DataTable)cb.D ataSource;
string cbText = cb.Text;
int rowIndex;
try
{
try
{
Cursor.Current = Cursors.WaitCur sor;
odbcDA_Names.Fi ll(dt);
DataView dv = new DataView(dt);
dv.Sort = "Name";
rowIndex = dv.Find(cbText) ;
MessageBox.Show (rowIndex.ToStr ing());
ByNames_cMgr.Po sition = rowIndex;

etc....

The MessageBox.Show call confirms that I've actually found the index of the
row that I'm looking for, but the Position assignment doesn't move the
pointer within the ComboBox dropdown list to that record.

Any help you can give will be greatly appreciated.
Nov 17 '05 #4
Please have look at my reply to Dmytro's post.

Thanks for your help!
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4323
by: Rowan | last post by:
Hi there, it has been a while since i have posted. I am in a situation where I am stumped. I am learning to build a dts package where I am connecting to a table in an AS400. This database is being maintained by an outsourced company and therefore I can't change the table structure or even ask them to. Anyway, this table currently has about 104,000 records. I am building a package to check it and pull out the most recent records and...
1
2624
by: discomiller | last post by:
Mario Mueller: Hello *, radiobuttons belong to other radiobuttons by the "name="any_value"" attribut. Thats a fakt. I got the following XML: **************************************************************
14
21913
by: Zenobia | last post by:
Hello folks, Is it possible to position an item within a <td> element? For instance see below. The table has multiple rows, one for each database record. Each row has 3 hrefs associated with it (for edit, delete and update). I want to position these 3 href items in the same columns, which would be posible if the span could be positioned - for instance on the extreme right of the td in which it is contained.
0
1670
by: Frnak McKenney | last post by:
I have a (small) multi-table database application which allows edits, print reports, and has two scrolling screen displays which show information merged from multiple tables. I'm having trouble with one of the scrolling displays which is implemented as a DataGrid with several custom DataGridColumnStyles. When the Form containing the DataGrid is made visible the initial rows of the DataGrid's DataView source display as one might expect....
4
1949
by: Joe | last post by:
can someone help me with this code (1) daNewEmployer.Fill(DsNewEmployer) (2) daNewEmployee.Fill(DsNewEmployer) (3)bmbEmployer = BindingContext(DsNewEmployer, "Employer") I am trying to fill a the bindingmanagerbase with two tables in the third line of code. However, it only takes two arguments, the dataset "DsNewEmployer" and the table "Employer". I need to add the "Employee" table to
4
1730
by: Jesse Villani | last post by:
I will get this eventually, I have a combobox on a form which is bound to a dataset and displays correct values in the list. When i select a value from the list, i check to see what is the current row in a bindingManagerBase object is in the selectedValue event handler code. I print out, on labels the following values: bmb.Count and bmb.Position where bmb is the bindingManagerBase object.
33
2478
by: Geoff Jones | last post by:
Hiya I have a DataTable containing thousands of records. Each record has a primary key field called "ID" and another field called "PRODUCT" I want to retrieve the rows that satisy the following criteria: I have a list of about 100 numbers which correspond to the ID field and also another 40 say numbers corresponding to the numbers in the PRODUCT field. I want to show the rows that correspond to both these criteria.
1
1429
by: dbuchanan52 | last post by:
My newly added row will not become current. I have several textboxes bound to a DataGrid1 and a couple of buttons including 'btnNewRecord'. The datagrid is bound to a table in a dataset. What happen is that btnNewRecord adds a new row to DataGrid1 as expected, however the active row does not move to the newly added row! What am I missing?
2
1298
by: Sam Malone | last post by:
I have these four methods to change the position in a table. However when I invoke any of them nothing appears to happen to the table. It doesn't scroll. The selector pointer doesn't move. Nada!! If I check the row in the table (DataTable2), it IS changing as it should and the DGV IS bound to the data table. Private Sub cmdFirst_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdFirst.Click...
0
8402
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8829
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8734
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8508
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7341
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6172
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4164
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2733
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1627
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.