471,599 Members | 1,251 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,599 software developers and data experts.

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 3334
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.com

"C Glenn" <no****@domain.com> wrote in message
news:O1****************@TK2MSFTNGP09.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
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 14 '05 #2
I'm stunned! Is there a concise but complete resource on these details?
The individual controls are bound like this:
txtTask.DataBindings.Add(new System.Windows.Forms.Binding( "Text",
dsCTasks, "Tasks.uidTask"));

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

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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Manuel Canas | last post: by
1 post views Thread by Manuel Canas | last post: by
reply views Thread by Dennis | last post: by
1 post views Thread by Doug Bell | last post: by
5 posts views Thread by Theodore | last post: by
2 posts views Thread by XIAOLAOHU | last post: by
reply views Thread by Anwar ali | last post: by

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.