Results 1 to 2 of 2

Thread: Sorting a BindingSource

  1. #1
    Member Thomas Dean's Avatar
    Join Date
    2005-12
    Posts
    10
    0 Did you find this post helpful? Yes

    Default Sorting a BindingSource

    Hello all. I was wondering if anyone could help me with sorting a bindingsource. In the Revit SDK 2015 samples, there is project called LevelsProperty. It has a datagridview linked to bindingsource1 that gets populated with Revit Level information. I would like to keep the datagridview sorted by "Elevation" but I can't figure out how to do this. By reading online, the bindingsource should be able to be sorted by using the line below but this doesn't seem to do anything.

    bindingSource1.Sort = "Elevation DESC"; // doesn't work but does not produce an error

    Any ideas?

  2. #2
    Member
    Join Date
    2011-11
    Location
    Saint-Omer, Pas-de-Calais, France
    Posts
    45
    0 Did you find this post helpful? Yes

    Default Re: Sorting a BindingSource

    SystemLevelsDatum is a List<LevelsDataSource>. It does not implement IBindingList or IBindingListView interfaces, so it does not support sorting (http://stackoverflow.com/questions/7...t-datagridview). Try to replace List<LevelsDataSource> by System.ComponentModel.BindingList<LevelsDataSource>
    Manager and software developer
    WIIP
    http://wiip.fr

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •