c# - Adding objects to a SortedBindingList -


I have a WinForm containing a dataform with a list of members in a group. Functionality (Bondage Navigator) is included in the form to add new members and change the role of current members. I want to be able to sort the members and want to apply this mixture to start the Sorted Bedding List . Although this has the unfortunate effect of denying me the ability to add new members to the team. I get the following exception:

The system Unknown Operation Exposure Occurred

Message = "Items can not be added to read-only or fixed size lists."

I understand the error, but is there any way around this or do I have to find another way to sort the list?

I have been using a lot of luck. Simply put your items in generic lists, and set up datasource in this way:

  Public Zero BindGenericList & lt; T & gt; (List & lt; T & gt; List) {DataSource = new BindingListView & lt; T & gt; (List); }  

It is easy to get rid of the actual object out of the list:

  Public Zero GetObjectFromRow & lt; T & gt; (Int rowIndex) {BindingListView & lt; T & gt; Compulsive Listview = Datacosaurus Binding Listview & lt; T & gt; Return (empty! = Binding List View)? Compulsive Listview [Row Indx]. Object: Default (T); }  

Sorting with BLV is actually.


Comments