Blog信息 |
blog名称:注册会计师(注会)练习软件 日志总数:398 评论数量:116 留言数量:27 访问次数:3267927 建立时间:2005年6月6日 |

| |
[borland eco 技术]eco中expressionhandle使用嵌套在DATAGRID中显示数据(转外文) 软件技术
吕向阳 发表于 2008/2/28 21:08:24 |
Jan Nordén [ Borland ]
Here is some information on nestings that I wrote in another context.
May be of use to someone. IMHO nestings are not all that useful in the winforms grid, but if there are third party treeviews or report generators that support them, they may come in handy.
I will try to explain in informally, using how it is displayed in the default grid for illustration.
To start of, the handles render the input list into a number of objects (shown as rows in a grid) with a number of properties (in most cases shown as columns in the grid") BTW the terminology for those properties in the .Net docs is very inconsistent, properties, columns, members.
These objects are the object int he IList implemented by the handles (and alse returned by GetList() for historical reasons).
The property/column/member:s are defined by the list also implementing ITypedList.
Each such property/column/member can be either a single value, or a new list (possibly of a single element). If it is a single value it can be displayed in a column.
If it is a list then in will be displayed in the Grid with a '+', which will fold out to a new (nested) set of rows.
The Nesting property is used to define which properties/column/member:s the object in that sublist will have. Some of these may in turn be lists, each Nesting value essentially has the same data-rendering properties as the handle itself, AddDefaultColumns, AddDefaultNestings, Colums.
A Column is defined as being a list by setting the Nested property to true. In this NestedName will specify which Nesting that defines the column for the objects in that list (which is usually and Eco class such as Person). If no name is given, the static type of the object in the list will be used as NestingName, and if the is no Nesting property for that Name, the default columns for that class will be used.
SO, let us say that you are a person, and want to be able to show you parents, and your childen, and you want to show the full information for you parents, but only the name of your children.
You would then add a column Parents with OCL expression 'self.Parents´, Nested=True, an no NestingName. This will lead to the default Person information being shown for the parents..
For the children, the expression would be "self.Children", Nested=true, and NestingName="PersonWithNameOnly"
You would then add a nesting with the name "PersonWithNameOnly", AddDefaultColumns set to false, and a single column for name in the Columns collection.
You can control the display of a particular nesting by adding a TableStyle to the grid with the TableName set to the name of the nesting.
So, the value of a handle can be a pretty general tree, rather than just a rectangle. |
|
|