Announcement

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

    Help nened with creating columns on fly for ListGrid

    I have several grids which are display data from datasource definition XML files which represent data from my database. XML files are generated with SmartClient designer.

    I want to add some extra custom columns which will be displayed only on UI based on some logick. For example columns with buttons to perform some actions.

    What is the best approach?

    #2
    You can define component-specific fields and still inherit the definition and behavior of DataSource fields. See this sample and notice the setUseAllDataSourceFields(true) call.

    Comment


      #3
      Thank you Isomorphic for prompt reply.

      Here is my piece if code which works:

      Code:
      		listGrid.setHeight100();
      		listGrid.setWidth100();
      		listGrid.setAutoFetchData(true);
      		listGrid.setShowFilterEditor(true);
      		listGrid.setCanEdit(true);
      		listGrid.setShowRecordComponents(true);        
      		listGrid.setShowRecordComponentsByCell(true);
      		listGrid.setAlternateRecordStyles(true);
      		listGrid.setShowAllRecords(true);
      		//listGrid.setShowRollOverCanvas(true);
      		
      		listGrid.setDataSource(ds);
      		listGrid.setUseAllDataSourceFields(true);		
      
      		ListGridField listFieldIcons = new ListGridField();
      		listFieldIcons.setType(ListGridFieldType.ICON);
      		listFieldIcons.setName("icons");
      		listFieldIcons.setTitle("Action");
      		listFieldIcons.setCanFilter(false);
      		listFieldIcons.setCanEdit(false);
      		listGrid.setFields(listFieldIcons);

      Comment


        #4
        Could figure out how to make my new column last in this grid - not first !! Whatever I do it always appear first, have no idea how to control that.

        Comment

        Working...
        X