In my app, the user enters data which gets stored into a
class. I then wish to display this info in a DataGrid with three
columns corresponding to the data entered (2 strings and 1 number).
Is there an easy way to get this into the DataGrid by using binding
or do I have to do manual insertion of the data?
Also, I'd like to let the user edit the DataGrid. But I don't
want him to be able to just type whatever he wants, I'd rather give
him a pop-up or combobox with the relevant options.
When you say the data gets stored in a class, do you mean an
object? One way would be to store the data in a user data value
object and then bind the object parameters to your DataGrid. If
there are multiple users, you could put the object in an
ArrayCollection and bind that to your DataGrid.
You could then use an itemRenderer or itemEditor for each
column that would allow the user to update the values with
comboBoxes and the updates would be reflected in the stored object.