Home Forums WPF controls Xceed DataGrid for WPF XAML control in DataGrid

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

    Hello!

    I have some XAML UserControls (animated icons) and I would like to know if it’s possible to bind them in a xceed DataGrid cell (and maybe some information about how to do it).

    Thanks!

    Imported from legacy forums. Posted by ovistanciu (had 458 views)

    Xceed Support
    Member
    Post count: 5658

    Any kind of control can be used in a DataGrid cell… I suggest checking the <a href=”http://doc.xceedsoft.com/products/XceedWpfDataGrid/Xceed.Wpf.DataGrid~Xceed.Wpf.DataGrid.Column~CellContentTemplate.html”>documentation on the CellContentTemplate property </a>for more details on how to include your custom controls…

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

    User (Old forums)
    Member
    Post count: 23064

    From what i can see there, i can add my control in the XAML. But i want a specific control to be added on that column for each row. That is, each row will have a different control, dependig on information known only at runtime.

    Is there a way to do this?
    Thank you in advance.

    Imported from legacy forums. Posted by ovistanciu (had 250 views)

    User (Old forums)
    Member
    Post count: 23064

    You can do it in your code (C# or VB):
    Look at example in Documentation:
    ms-help://Xceed.Wpf.DataGrid/Documentation/Xceed.Wpf.DataGrid~Xceed.Wpf.DataGrid.DataGridCollectionView.html
    in 2nd example, when creating DataGridCollectionView,

    DataGridCollectionView view = new DataGridCollectionView( typeof( Xceed.Wpf.DataGrid.DataRow ) );
    view.ItemProperties.Add( new DataGridItemProperty( ColumnName, typeof( YourControl Type ) ) );
    view.ItemProperties.Add( new DataGridItemProperty( ColumnName, typeof( TypeOfYourControl ) ) );
    And manually add items to your CollectionView.

    Imported from legacy forums. Posted by Lena (had 3793 views)

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