Results 1 to 2 of 2

Thread: Sorting a BindingSource

  1. #1
    Member
    Join Date
    2005-12
    Posts
    10
    Login to Give a bone
    0

    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
    Active Member
    Join Date
    2011-11
    Location
    Saint-Omer, Pas-de-Calais, France
    Posts
    58
    Login to Give a bone
    0

    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>

Similar Threads

  1. Object sorting
    By dgleason in forum AutoCAD General
    Replies: 4
    Last Post: 2008-04-22, 05:37 AM
  2. Material sorting
    By ronie_ernanto in forum AutoCAD 3D (2007 and above)
    Replies: 0
    Last Post: 2007-12-05, 01:56 PM
  3. Schedule Sorting
    By jnj1502 in forum ACA General
    Replies: 4
    Last Post: 2007-07-18, 04:58 PM
  4. Sorting Schedules
    By rob.walters in forum ACA General
    Replies: 3
    Last Post: 2007-02-15, 02:10 PM
  5. Schedule Sorting
    By chris.macko125036 in forum Revit Architecture - General
    Replies: 5
    Last Post: 2007-01-17, 06:53 PM

Posting Permissions

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