Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
790
Create dynamic properties and show them in ultratree as columns
posted

Hello,

It is needed that an user can create a query, but its not possible to know what the user wants to see (so his/hers select statement).  

So a colleaque of mine came up with an solution, dynamic properties. I have created a class that overides from PropertyDescriptor and implemented the methods, next i extended my dataclass with ICustomTypeDescriptor and implemented most of the methods here. In the GetProperties(Attribute attributes) method it first loops through the default excisting properties, next for testing purposes it will create a "Fake" property with some random data. When i debug through this, the data is being set correctly. But in the tree, only the first value is being shown. So when i use for example a random object that generates a value between 0 and 100 and the first value is 48. It will always show for every row 48 instead of the other values.

Can someone please help me with this, spend to much time on this problem and cant figure it out, neither can me colleague.

Thank you

Parents
  • 469350
    Suggested Answer
    Offline posted

    Hi Kevin,

    I don't see how this could be an issue with the tree. Seems more likely to be a problem with your custom PropertyDescriptor.

    Just to test this theory, try binding your data to some other control, such as the WinGrid, or the DataGridView and see if you get the same results.

    If the DataGridView or the WinGrid work okay and the tree does not, then that's pretty strong evidence that this is a problem with the tree. But I suspect that you will get the same behavior with any control.

Reply Children
No Data