473,714 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Currency Manager with Grid and Form Views

I have both a DataGrid and collection of data editing controls within a
form connected to the same table within the same DataSet with a
CurrencyManager . But they don't remain in sync with one another. I
expected that when I moved the row pointer within the grid that the
controls would point to the same row. But changing row within the grid
does not automatically change the CurrencyManager .Position.

How do you handle this?
Dec 13 '05 #1
2 3462
C Glenn,

Can you show how you are binding to the table in the grid and in the
controls? You have to bind to the same object, with the same path.

So, if in the grid you bound directly to the data table, and in the
controls you bound to the data set with the member set to the data table's
name, those are considered separate data sources. This will throw off your
binding.

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

"C Glenn" <no****@domain. com> wrote in message
news:O1******** ********@TK2MSF TNGP09.phx.gbl. ..
I have both a DataGrid and collection of data editing controls within a
form connected to the same table within the same DataSet with a
CurrencyManage r. But they don't remain in sync with one another. I
expected that when I moved the row pointer within the grid that the
controls would point to the same row. But changing row within the grid
does not automatically change the CurrencyManager .Position.

How do you handle this?

Dec 14 '05 #2
I'm stunned! Is there a concise but complete resource on these details?
The individual controls are bound like this:
txtTask.DataBin dings.Add(new System.Windows. Forms.Binding( "Text",
dsCTasks, "Tasks.uidTask" ));

I was doing this with the DataGrid:
dgTA.DataSource = dsCTasks.dtTask s;
(dtTasks was created like this: dtTasks = new DataTable("Task s");)

I've just switched to this:
dgTA.DataSource = dsCTasks;
dgTA.DataMember = "Tasks";

Now the two are talking to the same CurrencyManager . Thanks.

Nicholas Paldino [.NET/C# MVP] wrote:
C Glenn,

Can you show how you are binding to the table in the grid and in the
controls? You have to bind to the same object, with the same path.

So, if in the grid you bound directly to the data table, and in the
controls you bound to the data set with the member set to the data table's
name, those are considered separate data sources. This will throw off your
binding.

Hope this helps.

Dec 14 '05 #3

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

Similar topics

6
1800
by: Marina | last post by:
Hi, Let's say I have one datatable, that I want to use as the datasource for 2 dropdowns. So both are bound to the same one. But now, when I select a row in dropdown A, the selected row in dropdown B changes to the same thing! Each dropdown represents a different column in the main record - they just happen to have the same options for their valid values.
9
4294
by: Geraldine Hobley | last post by:
Hello I'm getting the above mentioned error in my applicatio I have a datagrid bound to a datasource like s MyDatagrid.DataSource = Mydataset.Tables(Order) - this all works fine However I have another field on the form which is a richtextbox and is bound to another field in the same datasourc like s Me.RtxtDialog.DataBindings.Add("text", MyDataset.Tables.Item("Orders"), "MyRichTextField") - this field accepts nulls in the databas
5
1562
by: Manuel Canas | last post by:
Hi there, I have a form with a couple of tabs on in and I'm filling the form from a dataset with the fill method. I am using a currency manager for binding controls with a datatable. mCurrencyManager = Me.BindingContext(dtTestTable) dtTestTable holds the table that loading on the form. I'm filling a listbox with names and the corresponding data gets displayed
1
1354
by: Manuel Canas | last post by:
I'm stuck here guys, need some help. I have a form with a couple fo tabs on it. I load a table in each for each tab. I populate a listbox with a list of names. Then I use currency manager to manipulate the datatables. This is my issue here, whenever I click on a name on the listbox the first currency manager currentchanged event fires, that works ok. Now I cannot find a way to pass the current selected item from the first currency...
0
1084
by: Dennis | last post by:
I seem to be able to instantiate a currency manager from a bindingcontext using an arraylist but changes I make to the arraylist don't seem to trigger any of the Currency manager's events. Apparently this is because ArrayList Class implements only Ilist but not IBindingList. Is this the reason and also, is there any way to get changes to the ArrayList to trigger the currency manager's events. -- Dennis in Houston
1
1360
by: Doug Bell | last post by:
Hi, Hi had a DataGrid on a form and was using the CurrentCellChanged Event to determine the selected row: Private Sub grdSelOrd_CurrentCellChanged(ByVal sender As System.Object, _ ByVal e As System.EventArgs) dacGetDataGridRow() Dim intRow As Integer = CType(Me.BindingContext(grdSelOrd.DataSource), _
5
2453
by: Theodore | last post by:
Hi, i have a class "MyClass" with a public property of datatable type. I also have a form with a public property of type "MyClass". The form has a datagrid which binds to MyClass.Table datatable. While navigating through the datagrid rows i can see the current position of MyClass.Table object through the currency manager (ctype(bindingcontext(Myclass.Table), currencymanager).position). How can i see the current position from within...
2
2082
by: grant | last post by:
Man do I struggle with Enterprise Manager as a graphical tool for building views etc. Its flaky and hangs frequenlty so i have to kill it with the task manager and re open it. You cant debug functions ( or am I missing something) But the worst thing is that it appears to cache the results of views and doesnt refresh from the source.
3
10376
by: Cdude | last post by:
I am using this code at the moment to format the column this.itemsDataGrid.Columns.DefaultCellStyle.Format = "c"; but i get the error "Object reference not set to an instance of an object. " is this code incorrect ? Any suggestions please
0
8802
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
9314
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...
1
9075
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
9017
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
7953
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
6634
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
5948
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4464
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...
2
2522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.