473,652 Members | 2,965 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Rows.Add and CurrencyManager

When I add a row to my DataTable my CurrencyManager doesn't know it's there.
I have a ComboBox and a CurrencyManager bound to a DataTable such that a
selection within the ComboBox causes all controls bound to that DataTable to
display the appropriate row. Fine. But when I do this:

dsTaskActivitie s.Tables["Tasks"].Rows.Add(NewTa skRow);

the CurrencyManager seems to ignore the new record. it shows up in the
ComboBox and I can DataTable.Rows. Find it, but nothing causes the
CurrencyManager to synch the rest of the controls to the selected row.

Any ideas on this?
Nov 17 '05 #1
1 2535
Christopher,

Are you expecting all of the controls selection to go to the new row?
If so, then that is incorrect. You would have to set the Position property
of the manager to the index of the new row, and then all the other controls
will synch themselves to that row.

If the controls are lists which are bound to the data in that list, then
make sure you are not bound to a view which could not filter out the new
row.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Christophe r Weaver" <we*****@nospam verizon.net> wrote in message
news:Ob******** ******@TK2MSFTN GP09.phx.gbl...
When I add a row to my DataTable my CurrencyManager doesn't know it's
there. I have a ComboBox and a CurrencyManager bound to a DataTable such
that a selection within the ComboBox causes all controls bound to that
DataTable to display the appropriate row. Fine. But when I do this:

dsTaskActivitie s.Tables["Tasks"].Rows.Add(NewTa skRow);

the CurrencyManager seems to ignore the new record. it shows up in the
ComboBox and I can DataTable.Rows. Find it, but nothing causes the
CurrencyManager to synch the rest of the controls to the selected row.

Any ideas on this?

Nov 17 '05 #2

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

Similar topics

1
4169
by: Junkguy | last post by:
I'm having difficulty deleting rows from a datagrid. I want to put a "delete" button on a form and achieve the same functionality as hitting the "delete" key on the keyboard for the selected row of a datagrid. I really want to do it generically so I have subclassed datagrid and made my own delete row method but I can only get it to work for datasources that are datatables or dataviews. Specifically when the datasource is a DataSet I...
3
1991
by: VMI | last post by:
I'm using Binding Manager to retrieve the current table row that the user clicked on (one highlighted row). But if I want to retrieve all the highlighted rows, how can I do it? This is the code to retrieve one row: DataRowView rowViewAudit = (DataRowView) ((CurrencyManager)BindingContext).Current; Now I want to modify this line so it retrieves all the highlighted rows. Is it possible?
3
4430
by: BBFrost | last post by:
Ok, I know how to count the number of selected datagrid rows using the code below. What has me stumped is how to determine when the selected rows within a datagrid have been changed. The DataGrid object doesn't seem to have a any type of a selection changed type of event I can grab. THE QUESTION: Does anyone know how to determine when the selected row or set of rows within a datagrid has changed ??? This is driving me nuts !
6
1706
by: BBFrost | last post by:
I'm using Net 1.1 (2003) SP1 & Windows 2000 Here's the issue ... Rows 12 thru 24 are selected in a datagrid. The user now unselects rows 12 thru 24 and selects rows 45 thru 70 ??? How can I tell that the user has reselected a different set of rows in a datagrid.
5
9173
by: BBFrost | last post by:
Win2000 ..Net 1.1 SP1 c# using Visual Studio Ok, I'm currently in a "knock down - drag out" tussle with the .Net 1.1 datagrid. I've come to realize that a 'block' of rows highlighted within a datagrid do >> not << constitute a set of 'selected' records. Apparently one and only one row may be 'selected' in a datagrid. By selected row I mean the row
0
979
by: David Alger | last post by:
Hi all, I'm using a CurrencyManager to manage the access to rows in my DataView (which most of the controls on my form are bound to). this.dvSampleTree = new DataView(ds.Tables); this.dvSampleTree.RowFilter="Kartong='" + this.CurrentTask.Details + "'"; this.cmTrees= (CurrencyManager)this.BindingContext;
15
9176
by: Rik Brooks | last post by:
I find it amazing that I am quickly able to find answers to obscure questions but simple ones elude me. I have a datagrid that I've bound, no problem at all. Now I want to - programatically - loop through each row, extracting the data held in each column. I can't figure out how to do that. It has to be simple, can somebody please help me? --
4
2711
by: skOOb33 | last post by:
I successfully autosized the columns and rows on my Datagrid, and am now facing another issue. Having the sorting ability by clicking the column headers is key, but when I do that, it resizes all my rows back to their defaults. I populate the datagrid, resize it accordingly and it works fine...just when I click the headers is when it messes up. It would be fine if I could run my autosizing again after the sorting is done since there...
2
3455
by: Lars Netzel | last post by:
Hi I need to have a limitation for the number of rows one can add in a datagrid (bound from a DataTable), in this case maximum should be 10 rows. My approach I guess is to catch the rownumber in the CurrencyManager via BindingContext.PositionChanged but how do I then stop new rows from being created? in FormLoad() I add a handler for the bindingcontext and a datatable called
0
8370
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
8283
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8704
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...
0
8590
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7302
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
6160
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...
1
2707
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
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1591
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.