与货币经理的头寸相关联的行不能隐藏 [英] Row associated with the currency manager's position cannot be made invisible
本文介绍了与货币经理的头寸相关联的行不能隐藏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个DatagridView。
我已经从一个类设置了它的DataSource。
I have a DatagridView.
I have set its DataSource From a Class.
taskerEntities te = new taskerEntities();
var OMsMasterDescriptiveIndicators = te.MyTable.Select(x => new lccls {Id = x.Id, name = x.name }).ToList();
MyGrid.DataSource = OMsMasterDescriptiveIndicators;
我的班级就像是
My Class is like
public class lccls
{
public string Id { get; set; }
public Nullable<decimal> name { get; set; }
}
在某个特定事件中,我希望Visible = False当前行。 />
At a certain event, I want to Visible = False the current row.
MyGrid.Rows[5].Visible = false;
但我无法做到这一点。我认为原因是它与`datasource`相关联。
所以,请你帮助我。
我怎么能这样做?
我对这个问题的看法是否正确?
错误是
But I am unable to do this. I think the reason is it's `datasource` associated.
So can you please help me.
How could I do this?
Is what I think about this problem is correct or not?
The Error is
> Row associated with the currency manager's position cannot be made<br />
> invisible
推荐答案
Google搜索找到 this [ ^ ]回答。
看起来你必须暂停绑定然后恢复绑定。我在上面链接的网页上改编了示例。
A Google search found this[^] answer.
It looks like you have to suspend binding and then resume binding. I adapted example from the web page found at the link above.
CurrencyManager currencyManager1 = (CurrencyManager)BindingContext[MyGrid.DataSource];
currencyManager1.SuspendBinding();
MyGrid.Rows[5].Visible = false;
currencyManager1.ResumeBinding();
这篇关于与货币经理的头寸相关联的行不能隐藏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文