?关于货币经营者&关系 [英] ? about currencymanager & relations

查看:81
本文介绍了?关于货币经营者&关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有一个包含2个datagrids的表单,显示master /

子项或订单/订单详细信息类型关系中的相关表数据。我想自动

选择订单详细信息表中的行,其中包含最高价格的

项目。我的想法是从订单详细信息中获取货币经理

表并通过每行迭代并跟踪最高的项目和行

并在完成后选择。我发现由于某种原因,订单明细表中的货币

经理始终是一个位置0,而不管在订单详情datagrid中实际显示的是什么
。 />

我做错了什么?


谢谢!!


解决方案

D,


您确定获得了正确的货币管理者吗?当你获得货币经理时,你需要通过使用DataRelation作为关键字而不是子数据来获得给你的经理


表(这就是为什么这个位置可能总是为零)。


希望这会有所帮助。

-

- Nicholas Paldino [.NET / C#MVP]

- mv*@spam.guard.caspershouse.com


D <沓** @ nothing.net>在留言中写道

news:uF ************** @ TK2MSFTNGP15.phx.gbl ...

hi

我有一个包含2个datagrids的表单,显示master /
子项或订单/订单详细信息类型关系中的相关表数据。我想自动选择订单详细信息表中包含最高价格商品的行。我的想法是从
orderdetails表中获取货币管理器并遍历每一行并跟踪最高的项目和行,并在完成后选择。我发现由于某种原因
订单明细表的货币经理始终是一个位置0
无论在订单详情datagrid中实际显示什么。

什么是我做错了吗?

谢谢!!




我想到了但我必须有错误的语法,因为我得到了

例外


_dsTests.Relations.Add(" MyTestRelation",

_dsCombinations.Tables [" Tests"]。Columns [" ID"],

_dsCombinations.Tables [" DailyTotals"]。Columns [" ID"]);

以后......

CurrencyManager myCurrencyManager =

(CurrencyManager)this.BindingContext [" MyTestRelation"];

cast无效

CurrencyManager myCurrencyManager =

(CurrencyManager)this.BindingContext [" Tests.MyTestRelation"];

cast无效


谢谢

Nicholas Paldino [.NET / C#MVP]" < mv*@spam.guard.caspershouse.com>写在

消息新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...

D,

你确定你得到了正确的货币管理者吗?当您获得货币经理时,您需要通过使用DataRelation作为关键字而不是子数据表来获得返回给您的经理(这就是为什么这个位置可能总是零。

希望这会有所帮助。

-
- Nicholas Paldino [.NET / C#MVP]
- mv*@spam.guard.caspershouse.com

D <沓** @ nothing.net>在消息中写道
新闻:uF ************** @ TK2MSFTNGP15.phx.gbl ...

hi

我有一个包含2个数据网格的表单,显示主/子项或订单/订单详细信息类型关系中的相关表数据。我想自动选择订单详细信息表中包含最高价格商品的行。我的想法是从
orderdetails表中获取货币经理并遍历每一行并跟踪最高的项目和行,并在完成后选择。我发现,由于某种原因,订单明细表的货币经理始终是一个位置0,而不管订单详情中显示的是什么。
datagrid。

谢谢!





D,


不要将带有数据关系名称的字符串传递给BindingContext。

相反,通过数据关系本身,你应该得到它。

-

- Nicholas Paldino [.NET / C#MVP]

- mv*@spam.guard.caspershouse.com

" D" <沓** @ nothing.net>在消息中写道

news:eX ************** @ TK2MSFTNGP12.phx.gbl ...

我想到了但是我必须有错误的语法,因为我得到了

_dsTests.Relations.Add(" MyTestRelation",
_dsCombinations.Tables [" Tests"])。列[" ID"],
_dsCombinations.Tables [" DailyTotals"]。列[" ID"]);
以后......
CurrencyManager myCurrencyManager =
(CurrencyManager)this.BindingContext [" MyTestRelation"];
强制转换无效
CurrencyManager myCurrencyManager =
(CurrencyManager)this.BindingContext [" Tests.MyTestRelation"];
演员无效

谢谢

Nicholas Paldino [.NET / C#MVP]" < mv*@spam.guard.caspershouse.com>在消息新闻中写道
:%2 **************** @ TK2MSFTNGP10.phx.gbl ...

D,

你确定你得到了正确的货币管理者吗?当您获得货币经理时,您需要通过使用DataRelation作为关键字而不是子数据表来获得返回给您的经理(这就是为什么这个位置可能总是零。

希望这会有所帮助。

-
- Nicholas Paldino [.NET / C#MVP]
- mv*@spam.guard.caspershouse.com

D <沓** @ nothing.net>在消息中写道
新闻:uF ************** @ TK2MSFTNGP15.phx.gbl ...

hi

我有一个包含2个数据网格的表单,显示主/子项或订单/订单详细信息类型关系中的相关表数据。我想自动选择订单详细信息表中包含最高价格商品的行。我的想法是从
orderdetails表中获取货币经理并遍历每一行并跟踪最高的项目和行,并在完成后选择。我发现,由于某种原因,订单明细表的货币经理始终是一个位置0,而不管订单详情中显示的是什么。
datagrid。

谢谢!






hi

I have a form with 2 datagrids showing related table data in a master /
child or order / order details type relationship. I would like to auto
select the row in the order details table which contains the highest priced
item. My thoughts were to get the currency manager from the orderdetails
table and iterate thru each row and keep track of the highest item and row
and select that when done. I have found that for some reason the currency
manager of the order details table is always a position 0 regardless of what
is actually showing in the order details datagrid.

What am I doing wrong?

Thanks !!


解决方案

D,

Are you sure you are getting the correct currency mananger? When you
are getting the currency manager, you need to get the manager which is
returned to you by using the DataRelation as the key, not the child data
table (which is why the position is probably always zero).

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

"D" <Da**@nothing.net> wrote in message
news:uF**************@TK2MSFTNGP15.phx.gbl...

hi

I have a form with 2 datagrids showing related table data in a master /
child or order / order details type relationship. I would like to auto
select the row in the order details table which contains the highest
priced item. My thoughts were to get the currency manager from the
orderdetails table and iterate thru each row and keep track of the highest
item and row and select that when done. I have found that for some reason
the currency manager of the order details table is always a position 0
regardless of what is actually showing in the order details datagrid.

What am I doing wrong?

Thanks !!




I thought of that but I must have the syntax wrong because I''m getting
exceptions

_dsTests.Relations.Add("MyTestRelation",
_dsCombinations.Tables["Tests"].Columns["ID"],
_dsCombinations.Tables["DailyTotals"].Columns["ID"]);
later...
CurrencyManager myCurrencyManager =
(CurrencyManager)this.BindingContext["MyTestRelation"];
cast not valid
CurrencyManager myCurrencyManager =
(CurrencyManager)this.BindingContext["Tests.MyTestRelation"];
cast not valid

Thanks
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl...

D,

Are you sure you are getting the correct currency mananger? When you
are getting the currency manager, you need to get the manager which is
returned to you by using the DataRelation as the key, not the child data
table (which is why the position is probably always zero).

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

"D" <Da**@nothing.net> wrote in message
news:uF**************@TK2MSFTNGP15.phx.gbl...

hi

I have a form with 2 datagrids showing related table data in a master /
child or order / order details type relationship. I would like to auto
select the row in the order details table which contains the highest
priced item. My thoughts were to get the currency manager from the
orderdetails table and iterate thru each row and keep track of the
highest item and row and select that when done. I have found that for
some reason the currency manager of the order details table is always a
position 0 regardless of what is actually showing in the order details
datagrid.

What am I doing wrong?

Thanks !!





D,

Don''t pass the string with the data relation name to the BindingContext.
Rather, pass the data relation itself, and you should get it.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"D" <Da**@nothing.net> wrote in message
news:eX**************@TK2MSFTNGP12.phx.gbl...

I thought of that but I must have the syntax wrong because I''m getting
exceptions

_dsTests.Relations.Add("MyTestRelation",
_dsCombinations.Tables["Tests"].Columns["ID"],
_dsCombinations.Tables["DailyTotals"].Columns["ID"]);
later...
CurrencyManager myCurrencyManager =
(CurrencyManager)this.BindingContext["MyTestRelation"];
cast not valid
CurrencyManager myCurrencyManager =
(CurrencyManager)this.BindingContext["Tests.MyTestRelation"];
cast not valid

Thanks
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:%2****************@TK2MSFTNGP10.phx.gbl...

D,

Are you sure you are getting the correct currency mananger? When you
are getting the currency manager, you need to get the manager which is
returned to you by using the DataRelation as the key, not the child data
table (which is why the position is probably always zero).

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

"D" <Da**@nothing.net> wrote in message
news:uF**************@TK2MSFTNGP15.phx.gbl...

hi

I have a form with 2 datagrids showing related table data in a master /
child or order / order details type relationship. I would like to auto
select the row in the order details table which contains the highest
priced item. My thoughts were to get the currency manager from the
orderdetails table and iterate thru each row and keep track of the
highest item and row and select that when done. I have found that for
some reason the currency manager of the order details table is always a
position 0 regardless of what is actually showing in the order details
datagrid.

What am I doing wrong?

Thanks !!






这篇关于?关于货币经营者&amp;关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆