繁体   English   中英

在BindingList中编辑项目<T>

[英]Edit item in BindingList<T>

它是列表中的代码编辑项

List<class1> lst = new List<class1>();

int index = lst.FindLastIndex(s => s.Number == textBox6.Text);
if(index != -1) { lst[index] = new Class1() { ... }; }

请转换为BindingList的代码

BindingList<class1> lst = new BindingList<class1>();

感谢名单

像这样吗?

var item = bindingList.Select((Item,Index) => new { Item, Index })
                      .LastOrDefault(x => x.Item.Number == textBox6.Text);
if (item != null)
{
    bindingList[item.Index] = new Class1() { ... };
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM