Using a propertyGrid in C# Winforms to store information in a grid

给你一囗甜甜゛ 提交于 2019-12-11 10:16:21

问题


Could anyone help me out on something that is confusing. I'm trying to create a grid to store information for example document details: (name, type, summary as example headers).

When the summary is too large for the cell of the grid I would like to have a button that would open a new control where the user is able to view more information.

Is it possible to to this using a propertyGrid and would anyone be able to point me in the right direction on information on doing this?

I was thinking it might be a case of writing a surrogate class and expose the objects created on it?

Thanks


回答1:


Yes it is posible.

You should create your own type that will provide document details as a set of type properties. You should then attach an instance of this type to the PropertyGrid. You can use attributes to change property visibility, editor, description and the others beheviours.

See Getting the Most Out of the .NET Framework PropertyGrid Control for further details.



来源:https://stackoverflow.com/questions/9226896/using-a-propertygrid-in-c-sharp-winforms-to-store-information-in-a-grid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!