btaib.blogg.se

Xojo datagrid
Xojo datagrid










xojo datagrid

Make ValidationRule also apply to other list object Suppose I have a object ListCollectionView and bind it to a datagrid. There might be cleaner ways to do it but that's the route I went. This is a bit hackish, but that way I can keep a reference to all my group objects - when I create the row viewmodels, they will have a ProductGroup property, and ProductGroup needs to point to the right pg in order for them to be grouped correctly. Note that I also added pg to a second private collection I created called _ProductGroupVMs. So by adding pg to the GroupNames collection means it can now be referenced and binded to in the xaml group header styling - it is the Name object. Me.BindedCV.GroupDescriptions(0).GroupNames.Add(pg) Now I add my own group objects to the CollectionView group descriptions: This means all rows (more specifically, the viewmodels that the rows are binded to) will be grouped according to a property called ProductGroup. Me.(New Data.PropertyGroupDescription("ProductGroup")) Me.BindedCV = New Data.CollectionViewSource And then in the xaml just do nested binding to Name.whatever for the group header controls.

xojo datagrid

The Name property of CollectionViewGroup is an object, so you can create a group view model of desired properties, then give that as the Name when adding group descriptions to the CollectionViewSource. But since CollectionViewGroup does not have a Status property, and I cannot supply my own CVGs to the CollectionViewSource, I've no idea how to do this simple task. This Status can change, so somehow the header will have to detect propertychanged notifications. This makes things difficult if you want the group header styles to bind to something other than what few properties the CVG's expose, like Name and ItemCount.īasically, I want every group to have a Status property, probably to be visually indicated by the group header background color.

xojo datagrid

You give the CollectionViewSource the group names, and it handles generating the CVG's behind the scenes. It appears the group header templates bind directly to CollectionViewGroup objects, but for some reason these aren't very accessible inside the CVS. WPF datagrid - flexible binding for group headers - wpf I have a wpf datagrid with grouped rows, implemented using a CollectionViewSource.












Xojo datagrid