自定义对象 [英] Custom object

查看:125
本文介绍了自定义对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用CollectionBase类编写的自定义对象,允许我添加相同类型的子代.我在该对象中也有多个变量,我希望能够获得这些变量之一的所有出现并将它们添加到数据表中.

我正在尝试与属性网格和数据表建立拖放关系,因此当我将一个变量从属性网格拖到数据表时,数据表将创建一列,并用该变量的所有出现填充每一行,所以我可以看到整个结构.

我需要知道如何将主要对象转换为customobject.children中每次出现的customobject都已放置到datagrid上的customobject.

我想知道是否有人知道这样做的巧妙方法.

抱歉,我没有在atm上工作的任何示例代码.

I have a custom object that i have written with the CollectionBase Class to allow me to add children of the same type. I also have multiple variables in that object, i would like to be able to get all occurrences of one of those variables and add them in a datatable.

I am trying to set up a drag and drop relationship with a property grid and a data table so when i drag a variable from the propertygrid to a datatable the datatable will create a column and fill each row with all occurrence of that variable, so i can see the whole structure.

I need to know how to convert the main object to the customobject.variable that has been dropped onto the datagrid for each occurrence of customobject in customobject.children.

I was wondering if anyone knew of a neat way of doing this.

sorry i dont have any example code I am at work atm.

推荐答案

我可以做很多解释,但是有关此问题的所有信息都可以在下面的链接中找到.只需实现IDataObject.

http://msdn.microsoft.com/en-us/library/system.windows.forms.control.dodragdrop.asp [ ^ ]

祝你好运!
I could do a lot of explaining but everything about this question can be found at the link below. Just implement the IDataObject.

http://msdn.microsoft.com/en-us/library/system.windows.forms.control.dodragdrop.asp[^]

Good luck!


这篇关于自定义对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆