Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Problem with ListGridField setOptionDataSource

    I am trying to use the same datasource in diferent columns, but display different fields.

    Code:
            DataSource dsitems=new DataSource();
            dsitems.setClientOnly(true);
            ...
            ...
            ListGridField fitem=new ListGridField("Item","Item",150);
            fitem.setOptionDataSource(dsitems);
            fitem.setDisplayField("Name");
            fitem.setValueField("id");
    
            ListGridField fdesc=new ListGridField("Item","Description",250);
            fdesc.setOptionDataSource(dsitems);
            fdesc.setDisplayField("Description");
            fdesc.setValueField("id");
    But unfortunately I see Description in "Item" column and ID in "Description" column. What's wrong in my code?
Working...
X