Home Forums WPF controls Xceed DataGrid for WPF How to point a property in the same class

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

    Hello!!

    I have created a UserControl
    <UserControl x:Class=”Operations.FirstOperation”
    xmlns:xcdg =”…wpf/xaml/datagrid”
    >
    <Grid>

    <xcdg:DataGridControl x:Name=”OperationGrid”
    ItemsSource=”{Binding Path=OperationList”}>
    ….
    </xcdg:DataGridControl>
    </Grid>
    </UserControl>

    Inside the FirstOperation Class

    Namespace Operations

    Partial Public Class FirstOperation
    Private data As OperationDataContext

    Public Sub OnInit()
    data = new DataContext
    data.OperationList = GetoperationList()
    Me.DataContext = data
    end sub

    End class
    End NameSpace

    Public Class DataContext
    Private operationListField As List(Of Operation)
    public Property OperationList
    Get

    End Get
    Set

    End Set
    End Property
    end class

    Public class Operation
    private OrderField As integer
    public Property Order
    get…
    set …
    end property

    ….
    end class

    That’s working. But I wont to sort my operations by the Order property
    What should I write instead of ??????

    <Grid.Resources>
    <xcdg:DataGridCollectionViewSource x:Key=”operList” Source={Binding Source={???????}, Path=OperationList}”>

    <xcdg:DataGridCollectionViewSource.SortDescriptions>
    ….
    </xcdg:DataGridCollectionViewSource.SortDescriptions>
    </xcdg:DataGridCollectionViewSource>
    </Grid.Resources>

    Imported from legacy forums. Posted by Sergey (had 385 views)

    Xceed Support
    Member
    Post count: 5658

    Since you are using a UserControl, my suggestion for the moment would be to create a DataGridCollectionView in the code behind to wrap your operation list and assign it a SortDescription directly… You can then assign the DataGridCollectionView to the UserControl’s DataContext.

    It seems there is currently a limitation with the DataGridCollectionViewSource where the Source can only be bound using a static source.

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

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