1 Reply Latest reply on Jan 30, 2008 6:32 PM by chris.huston.t10

    Bind user generated info to DataGrid & edit with comboboxes

    Solerous
      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.

      Any suggestions about this approach?
        • 1. Re: Bind user generated info to DataGrid & edit with comboboxes
          chris.huston.t10 Level 3
          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.

          Vygo