Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8323935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:52:44+00:00 2026-06-08T23:52:44+00:00

Hello I need to get two collections as XpCollections, but cMemberInfo.GetValue(this) brings me type

  • 0

Hello I need to get two collections as XpCollections, but “cMemberInfo.GetValue(this)” brings me type “DevExpress.Xpo.XPCollection`1” is it possible to convert it in some way to the
DevExpress.Xpo.XPCollection?

                XPCollection cColl1 = cMemberInfo.GetValue(this) as XPCollection;
            XPCollection cColl2 = cMemberInfo.GetValue(cObject) as XPCollection;

As the result of not converting type both cColl are null

there is full part of code where these collections are used

            foreach (XPMemberInfo cMemberInfo in ClassInfo.CollectionProperties)
        {
            XPCollection cColl1 = cMemberInfo.GetValue(this) as XPCollection;

            XPCollection cColl2 = cMemberInfo.GetValue(cObject) as XPCollection;

            if (cColl1 == null || cColl2 == null) { Debug.Assert(false); return false; }
            if (cColl1.Count != cColl2.Count) { return false; }

            for (int i = 0; i < cColl1.Count; ++i)
            {
                XPOBase cObj1 = cColl1[i] as XPOBase;
                XPOBase cObj2 = cColl2[i] as XPOBase;

                bRet &= cObj1.IsDataEqual(cObj2);
            }
        }

if I use XPBaseCollection in case of XPCollection I cannot declare cColl1[i] or cColl2[i]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T23:52:45+00:00Added an answer on June 8, 2026 at 11:52 pm

    GetValue is returning a generic XPCollection<T> where T is the type of the objects of the collection.

    XPCollection<MyType> cColl1 = cMemberInfo.GetValue(this) as XPBaseCollection<MyType>;
    XPCollection<MyOtherType> cColl2 = cMemberInfo.GetValue(cObject) as XPBaseCollection<MyOtherType>;
    

    Or you could use XPBaseCollection instead:

    XPBaseCollection cColl1 = cMemberInfo.GetValue(this) as XPBaseCollection;
    XPBaseCollection cColl2 = cMemberInfo.GetValue(cObject) as XPBaseCollection;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I need to do something like this: UPDATE tbl SET pozn=CONCAT(pozn, '+attach_str+') WHERE
Hello i am in desperate need of help on this i have an image
Suppose you have a simple block of code like this: app.get('/', function(req, res){ res.send('Hello
This sounds very simple, I know, but for some reason I can't get all
Hello I have a homework assignment where I need to read two matrix .txt
I need to do this:- MyClass.cs using System; using System.Collections.Generic; using System.Text; namespace set_property__Enum_To_Nullable_Enum
Hello on page load we get two buttons while clicking on 1st button one
Thanks for all the great answers, this helps a lot! Hello, I need some
Hello friends I have been using this query to select some two fields on
Hello i need to create a progressView when i load data from my webservice.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.