473,811 Members | 3,532 Online
Bytes | Software Development & Data Engineering Community
+ 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 2058
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
5455
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 threads. If I link the BindingList<T> implementation to a grid (grdNodes.DataSource = Nodes.List), I get a thread exception when I try to add a new object using a worker thread.
4
3522
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 and bind them to a datagrid using BindingList. I am in need of an epiphany here. Thank you. -Greg ******************BIND ARRAY OF CUSTOMER OBJECTS TO DATAGRID ************************ private Customer c; c =...
1
3046
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. The expected behavior would be for each of the first three to contain different sets numbers. public Form1() { InitializeComponent();
1
3110
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 list. The problem happens when: - I use such a BindingList as DataSource for a BindingSource. - Add this BindingSource as DataSource for a DataGridView. - And go to the NewRow and add a new row in the DataGridView.
3
2024
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 BindingList datasource, and then a ListChanged event should fire from the BindingList. However, the bindinglist's ListChanged event is not firing until a second key is pressed. I can press one key and nothing happens, but on the second key,...
5
7594
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 datagridview. I would like the ability to add to this collection or delete from this collection using the grid. I know I will need to use Bindinglist<T> for this but I don't seem to be able to cast from
6
16840
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 data grid view - they both work. Are there aspects of databinding that the regular list will not support and vice-versa, is there any reason to choose a regular list over the bindinglist? -Jeff
1
5109
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
9701
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 cool little feature - it will not call DataTable.Rows.Add until after you leave the DataGridView row. This is cool because it lets your user edit the record as much as needed to get it into a valid state before actually adding it to the DataTable.
0
9724
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10394
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9201
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7665
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6882
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5552
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.