Home Forums WPF controls Xceed DataGrid for WPF non-DataRowView support for ICustomTypeDescriptor?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #22715 |

    I see in your WPF DataGrid sample that you support ICustomTypeDescriptor in your data binding via DataTables (specifically, via DataRowView). However, if I set the ItemsSource property via an IEnumerable of objects that implement ICustomTypeDescriptor in some other way, I get a bunch of empty rows. What am I doing wrong? Thanks!

    Chris Sells
    http://sellsbrothers.com

    Imported from legacy forums. Posted by Chris (had 4413 views)

    Xceed Support
    Member
    Post count: 5658

    I`d like to confirm something: At the moment you bind the IEnumerable data source to the DataGridControl, is the data source empty?

    If the answer is yes, then that would be the problem… to detect “columns” on a ICustomTypeDescriptor, we need an instance of the object… ( If the answer is no, let me know, and well make sure to take a look at this).

    At the same time, I can suggest implementing ITypedList on your IEnumerable collection. This way, we can detect the properties of the object without accessing an object’s instance.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 301 views)

    User (Old forums)
    Member
    Post count: 23064

    No — the list is not empty when I set it to the ItemsSource property.

    Imported from legacy forums. Posted by Chris (had 332 views)

    Xceed Support
    Member
    Post count: 5658

    Good, I’ll take a deeper look into this…

    In the mean time, it would help if you could provide me with as much “additional” information as possible concerning your data source (is it only implementing IEnumerable or does it implement other interface/ collection classes ).

    Imported from legacy forums. Posted by Marcus [Xceed] (had 238 views)

    User (Old forums)
    Member
    Post count: 23064

    The source of the data is the standard ICustomTypeDescriptor implementation that comes with PowerShell. You can download a sample that demonstrates the problem at http://www.sellsbrothers.com/secret/gonad.zip. (The code in question is in the ExecuteCommand function in the MainWindow.xaml.cs file.)

    Imported from legacy forums. Posted by Chris (had 629 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi Chris,

    Sorry for taking so long before getting back to you, we were putting the final touches on our soon-to-be-released v1.1…

    PSObject uses a type description pattern that we were not aware of, and therefore never implemented in our DataGrid (nor in our Windows Forms grid): the TypeDescriptionProvider class/attribute that was introduced in .Net 2.0.

    I’ve filed a case for that and we will support it by the next release (the one after 1.1).

    Imported from legacy forums. Posted by Pascal (had 515 views)

    User (Old forums)
    Member
    Post count: 23064

    1.2 is now available, you can download the fix <a href=”http://xceed.com/pages/TopMenu/Downloads/Trials.aspx”>here </a>

    Imported from legacy forums. Posted by Matt (had 5513 views)

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.