How to access expressionhandle column values at runtime
CapableObjects Forums
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



How to access expressionhandle column values... Expand / Collapse
Author
Message
Posted 2010-03-30 09:16:46
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 2012-01-23 17:45:58
Posts: 49, Visits: 72
Hi,

the structural data of additional columns assigned to an expressionhandle can be accessed by ExpressionHandle.Columns. But how to get the corresponding column values of all rows of an expressionhandle by code?

The ExpressionHandle.Element property seems to provide the model based properties only.

Alois

Post #5075
Posted 2010-03-30 13:06:44
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: 2010-08-12 17:32:24
Posts: 51, Visits: 600
Hi

You need to add a CurrencyManagerHandle and set it's ReferenceHandle to the ExpressionHandle.

The CurrencyManager then points to the current row of the expression handle and you can cycle through from that using the Currency Managers position property.

Nick

Post #5078
Posted 2010-03-30 16:08:56
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 2012-01-23 17:45:58
Posts: 49, Visits: 72
Thanks for your reply.

The problem is not to iterate over all rows but to get access to the values of those columns that are additionally connected to the expressionhandle and are not original attributes of the underlying UML-class.

Post #5079
Posted 2010-03-31 08:06:01
Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 2012-01-23 17:45:58
Posts: 49, Visits: 72
Problem solved:

    PropertyDescriptorCollection descriptorCol = (rhQuery as ITypedList).GetItemProperties(null);
    foreach (Object oObj in rhQuery)
    {
     foreach (PropertyDescriptor oPd in descriptorCol)
     {
      ...oPD.Name;  ...oPd.GetValue(oObj).ToString();

Thanks to Jan, who posted this solution some years ago in the former Borland.eco.newsgroup.

Note: If using a CurrencyManagerHandle instead of its RootHandle you don't get the additional columns!

Alois

Post #5084
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: HansKarlsen, Jonas Hogstrom, PeterMorris

Permissions Expand / Collapse

All times are GMT +1:00, Time now is 9:39

Powered By InstantForum.NET v4.1.4 © 2012
Execution: 0,250. 9 queries. Compression Disabled.