Selected object in datagrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all (once again),
I've populated a datagrid with an arraylist of objects of this class i've
created.

How can I get the select object in the datagrid?

TIA,
DC
 
If you are wanting the value of a cell, you would use

datagrid.item(datagrid.currentcell)

you should use that within a mouseDown or mouseUp event of the
datagrid. I dont know if that answers your question, because I dont
100% understand it.
 
Thanks,
Here's exactly what I want: Just like Listbox select item returns a
reference for MY object, I would like to know if there's any way to have the
reference for MY object in the select item of a datagrid. I don't want to get
the cell value, but a reference to the object of my arraylist.
I hope that's clear now.
 
datagrid.item(datagrid.currentcell) is pretty much like a
listbox.selectedItem, they both bring back the value of whats selected.
If you wanted to get the row number of the datagrid thats selected you
could use datagrid.currentRowIndex but I dont know if that corresponds
to your arraylist. Im guessing that the order of your datagrid won't
always be the same as the arraylists order, so I think you could get
the cell value of the selected row in the datagrid and search for its
position in your arraylist. Is this sort of what you're looking for?
 
Back
Top