Include a static item in a databound list control

Include a static item in a databound list control

Post by Tom McDonn » Tue, 26 Aug 2003 11:10:09


I'm wanting to have a static 'All items' entry appear as the first item
in a data-bound combobox. The underlying data is sorted, and will be
added to/modified/deleted. Maintaining a separate table which is a
manually ordered version of the original table with the desired entry as
the first item, and binding to it is quite a task. Are there any simpler
solutions?
 
 
 

Include a static item in a databound list control

Post by One Handed » Tue, 26 Aug 2003 17:54:18

Good question, not sure either but I will look into it

--
Regards - One Handed Man

Author : Fish .NET & Keep .NET

==============================

 
 
 

Include a static item in a databound list control

Post by Marin » Wed, 27 Aug 2003 02:31:58

You can bind the combobox, and the insert a new item that says All Items as
the first item.
 
 
 

Include a static item in a databound list control

Post by Tom McDonn » Wed, 27 Aug 2003 10:15:40

Thanks for the reply but this really doesn't work. With the list sorted
an item can appear before an 'All Items' entry, 'AAA' for example.
 
 
 

Include a static item in a databound list control

Post by One Handed » Wed, 27 Aug 2003 21:38:14

Yes your right it doesent work. IN fact doing this will throw an exception
when the listbox is bound to a datasource.

I tried using the insertAt method of the table, but for some reason it wants
to put the row at the end regardless of what position you want to try and
insert it!!

--
Regards - One Handed Man

Author : Fish .NET & Keep .NET

==============================



as