31 Replies
when i try to add an item from the list, it just displays this
each item is tied to a location
instead of the corresponding item it just says blaisefinalproject.item and only allows one to be added
it is probably simply calling
ToString
on your object to determine what to display in the list
so the quick and dirty fix would be to override ToString for your item to display what you want
i would expect there to be a better way but i avoid winformsi also do not like winforms this is for a school assignment ..
also thanks i’ll try that ❤️
ok@i feel a little silly how would i do that
where do i put the .ToString
you need to override that method in your Item class
errr
like
oh yeah
silly me
i’ve done that before in this project already
hmm
why are you writing that?
um
to convert it to a string.. : P
you don't need to
well
winforms is calling it itself
it doesn’t work still..
WAIT
ok it works kind of
now it gets the correct item but
i can only store one?
store one where?
when i try to add more items nothing happens
if you update the list you need to tell winforms it updated somehow
only the first is registered
which is where my knowledge of winforms stops
i shall look this up
i don't know if winforms has data binding but that's what i'd use in other frameworks
i think it’s just .Refresh
ok nope
anyone else know what’s up with this
it just displays the first item i get and nothing else
my assignment is due soon... i hope help arrives..
what does this mean..
nvm IT WORKS
solved.
got it.