如何在 Winforms 的 Infragistics UltraGrid 控件中按索引删除行?
我有一个 Windows 窗体,里面有一个 UltraGrid 组件。
我想通过使用数字索引来删除一行,如何实现这一点? Infragistics 的文档非常缺乏,我似乎找不到相关信息。
有什么建议吗?
I have a Windows Forms and inside I have an UltraGrid component.
I'd like to delete a row by using it's numerical index, how can I achieve this? The documentation for Infragistics is extremely lacking and I can't seem to find relevant information.
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议从 WinGrid 绑定到的列表中删除该项目,这会将其从网格中删除。如果您知道列表中项目的索引,则可以使用RemoveAt 方法将其从列表中删除。
如果您有对要删除的 UltraGridRow 对象的引用,则可以使用将 UltraGridRow 的 ListObject 属性传递给列表的 Remove 方法的 Remove 方法。
艾伦
I would recommend removing the item from the list that the WinGrid is bound to and this would remove it from the grid. If you know the index of the item in the list, then you could remove it from your list using the RemoveAt method.
If you have a reference to the UltraGridRow object that you wish to remove, then you could use the Remove method passing in the ListObject property of the UltraGridRow to the Remove method of your list.
Alan
我找到了这个示例代码;
另请参阅这些文章
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle .aspx?ArticleID=7384
http://forums.infragistics.com/forums/p/24697/90536.aspx
<一个href="http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=7384" rel="nofollow">http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=7384
I found this sample code;
Also take a look these articles
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=7384
http://forums.infragistics.com/forums/p/24697/90536.aspx
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=7384