473,466 Members | 1,405 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Nutty Sorted BindingList Problem

Hi

I have a simple problem scenario with yet no good solution:

I want: A sorted (by name) and bindable typesafe collection (of students)
which I can set as DataSource to a ListBox. When editing a students name in
a databound textbox, the name in the listbox should update and also resort
itself (while also keeping this student in focus).

I dont want to use DataGridView since its to complex. I just want a simple
selectable text item. Thats it.

How can this be done??

Previous attempts in .NET 1.1 with CollectionBase (and IBindingList) and
InnerList.Sort() almost worked. There, the problem was that when editing the
name (and manually sorting the list), the datamanager lost focus on the
previous student if it was moved while sorting and now selected a different
student.

New attempts in .NET 2.0 with a generic BindingList<T> revealed that
InnerList.Sort() is not available anymore at all??

I don't get this at all. This should be simple, yes? A simple list of
students with a binding to a sorted listbox and a textbox. Any help is
greately appreciated!!!

/Andreas Zita
Nov 22 '05 #1
1 2034
Okey so InnerList is replaced by converting IList<T> this.Items to a generic
List<T>, it seemes. The other focus problem was solved also ... by not
invoking Reset but ItemMoved instead after a Sort-call.

/Andreas Zita

*Thread Closed*
Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Frank VDL | last post by:
Hi, To be able to show my objects in a Grid, I've inherited my list implementation from BindingList<T>. The problem is that de objects in this list are created/changed/deleted in different...
4
by: hazz | last post by:
The data access layer below returns, well, a mess as you can see on the last line of this posting. What is the best way to return customer objects via a datareader from the data layer into my view...
1
by: Dave Booker | last post by:
Is there a reason why the BindingList constructor doesn't create a new BindingList? Create a form with four ListBoxes and the following will result in them all containing the exact same thing. ...
1
by: Pieter | last post by:
Hi, I have a custom List that inherits from BindingList. It has some methods overloaded, like the Add/Insert/etc to add and remove some eventhandlers when adding or removing an item T of the...
3
by: Bryan | last post by:
I am calling BindingList.EndEdit during a 'TextChanged' sub for a texbox. In theory, the key should be pressed changing the value in the text box, the EndEdit call should append the changes to the...
5
by: Mike Surcouf | last post by:
Hi All I have a stored procedure wrapper that returns Collection<T>. The wrapper is generated by codesmith so I don't really want to start altering it. I need to use this collection in a...
6
by: jwilson128 | last post by:
I am trying to decide whether to use a system.ComponentModel.BindingList(of T) or a Sytem.Collections.Generic.List(of T) for a custom collection. In testing a simple, read-only data binding to a...
1
by: =?Utf-8?B?RWl0YW4=?= | last post by:
Hello, I have a ComboBox named comboBoxSelChannel. I declared a structure named MySturct. public struct MyStruct { public int Index; public string Name;
3
by: jehugaleahsa | last post by:
Hello: I am binding a DataGridView with a BindingList<T>, where T is a custom business object that implements INotifyPropertyChanged. When you bind a DataGridView to a DataTable, it has this...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.