databinding problem

O

Ondrej

perhaps someone could help a newbie with his big problem.

i have an arraylist with objects (class i made with two properties).
and i'd like to bind it to a datagrid. there are 3 buttons on the
form which should works as add, edit and delete. the problem i have
is everytime i use these buttons, they add(edit, delete) object to the
arraylist but i don't know how to refresh the datagrid. should i call
the method i use for databinding again? especially when i delete an
object, there is some inconsistency and the program collapses.

a piece of code would be appreciated very much :)
 
C

Cor Ligthert

Ondrej,

It is so easy to bind a datatable to an datagrid, and such a lot of work to
do the same with an arraylist, that I always have the idea than nowbody
likes to explain that in these newsgroups.

What is the same for me, because it is always a lot of work to find where I
stored that solution while I never will use that myself.

And therefore why don't you use a datatable?

Just my thought,

Cor
 
O

Ondrej Bohaciak

sure why not, if you can give me some advice on how to do that.
i was posting this, because i work with the arraylist everywhere in the
program so it might be good to convert the arraylist to the datatable
somehow. i would really hate to create to make changes to the code
everywhere i use arraylist.. and don't forget about some helpful code :)
 

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