listbox and editing

G

Guest

I'd like to modify the standard .net list box to allow in place editing of
the data.

I am owner drawing a complex listbox item, but first off, is this even
advisable?

I have a simple list and I'd like the user just to be able to right click,
selected edit, and be thrown onto the listbox to edit.

I tried dropping a textbox onto the item in the Drawitem function, but I
couldn't seem to make that work appropriately.

Anyone have any general strategy ideas on how this could be done, if at all?
 
C

Cor Ligthert [MVP]

Dan,

You can set by options a datagrid in a way that it looks almost as a
listbox, why not using that?

Cor
 
G

Guest

Cor,

Thanks for the response. The datagrid is very "heavy" compared to the
listbox; on top of that I am owner-drawing the display of the listbox to a
very custom layout and it works very well - it can very handily display all
the data I want with no special hacking around.

I think if my current approach to inline editing fails I'll just use a
sub-window that pops up for editing.

--dan
 
C

Cor Ligthert [MVP]

Dan,

What do you mean with heavy? It is just a control in the framework, the same
as the listbox is.

Cor
 
G

Guest

Cor,

If you setup a simple test you can see what I mean. Load up a listbox on a
form, add 10,000 items, and remove half of them. Take a look at how many
memory the process is using.

Do the same with a datagrid.

The result is that the datagrid uses 2x-3x the memory of the listbox. It's
especially bad when you have more than one on a form; forwhatever reason the
listbox is many times more efficent, and noticeablely faster loading data and
becoming responsive after large operations.

On top of that, it's easier for me to customize the layout by owner drawing
the listbox to fit exactly the layout I want for each item.

--dan
 
C

Cor Ligthert [MVP]

Dan,

Of course can the listbox process data more efficient, although what is it
processing. It is an only displaying control. The datagrid has large
possibilities to edit, update and insert data down to a datasource
(editing).

You never get possibilities for nothing.

However I had the idea that editing was your question.

Sorry for misunderstanding you

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top