C# WinForms 的可编辑数据网格
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/114707/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Editable data grid for C# WinForms
提问by Andrew
I need to present the user with a matrix of which one column is editable. What is the most appropriate control to use?
我需要向用户展示其中一列可编辑的矩阵。最适合使用的控件是什么?
I can't use a ListView because you can only edit the first column (the label) and that's no good to me.
我不能使用 ListView,因为您只能编辑第一列(标签),这对我没有好处。
Is the DataGridView the way to go, or are there third party alternative components that do a better job?
DataGridView 是要走的路,还是有第三方替代组件做得更好?
采纳答案by Phil Wright
DataGridView is the best choice as it is free and comes with .NET WinForms 2.0. You can define editable columns or read-only. Plus you can customize the appearance if required.
DataGridView 是最好的选择,因为它是免费的并且带有 .NET WinForms 2.0。您可以定义可编辑的列或只读的。此外,您可以根据需要自定义外观。
回答by Greg Ogle
DataGridView is good.
DataGridView 很好。
If you prefer a prettier interface, Telerik controlsare better.
如果您喜欢更漂亮的界面,Telerik 控件会更好。
回答by John Rudy
If DataGridView will handle your needs, it's the right answer. Another option (although it seems to be unpopular around these parts!) is Infragistics NetAdvantage. The downsides to Infragistics are primarily a high cost and somewhat steep learning curve; the upsides are that these are some of the most powerful controls you'll ever find -- so if you need their flexibility, go for it.
如果 DataGridView 能够满足您的需求,那就是正确的答案。另一种选择(尽管在这些部分似乎不受欢迎!)是Infragistics NetAdvantage。Infragistics 的缺点主要是成本高且学习曲线有些陡峭;好处是这些是您能找到的一些最强大的控件——所以如果您需要它们的灵活性,那就去吧。
I don't have experience with Telerik (which has been mentioned by others here), but they do seem quite good. Being that my company has invested fairly heavily in Infragistics, we're not liable to switch any time soon ...
我没有使用 Telerik 的经验(这里的其他人已经提到过),但它们看起来确实不错。由于我的公司在 Infragistics 方面投入了大量资金,因此我们不会很快就切换......