简体   繁体   English

如何在Visual Studio中向表单添加属性表?

[英]How to add a property table to a form in Visual Studio?

I don't have much experience with C# or VS, but I want to add a property table to a form, like this one: 我没有使用C#或VS的丰富经验,但是我想向表单添加属性表,如下所示: 替代文字

So that columns are resizable, editable, of different types (eg checkbox for boolean) and sortable. 这样,列可以调整大小,可编辑,具有不同类型(例如,布尔值的复选框)并且可以排序。 How do I do that? 我怎么做?

That looks like a WinForms Listview and that should be able to support everything you need. 看起来像WinForms Listview ,应该能够支持您需要的一切。 Just add it to the form, change it to the View property to Details and then when you add the columns you can set their types as checkbox column etc. 只需将其添加到表单,将其更改为View属性的Details ,然后在添加列时可以将其类型设置为复选框列等。
You can either bind it to a datatable or similar or add the data manually by add to it's Items property (and you add the other columns data by adding sub items to each item). 您可以将其绑定到数据表或类似表,也可以通过将其添加到Items属性中来手动添加数据(并通过向每个项目添加子项目来添加其他列数据)。

I'd suggest trying that out first and then come back with separate questions for anything that you're having problems with. 我建议您先尝试一下,然后再针对您遇到的任何问题提出单独的问题。

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

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