umarbeyoglu
umarbeyoglu

Reputation: 450

XAF - How to show only specific data in listview that is defined inside ViewController?

So I have managed to filter the data I wanted to get from SQL. But the problem is I can't find a way to show this data inside Listview I am trying to create. It shows me all of the data instead of this particular data.

  private void assignTasksAction_CustomizePopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e)
  {
      IObjectSpace objectSpace = View.ObjectSpace;
      mamüller mainitem = (mamüller)View.CurrentObject;
      string itemid = mainitem.ID.ToString();
      IList tasks = objectSpace.GetObjects(typeof(LG_124_ITEMSUBS), CriteriaOperator.Parse(@"[MAINITEMREF] = "+itemid+" ", TaskStatus.Running));
      foreach (LG_124_ITEMSUBS task in tasks)
      {
          //Get altMalzemeler Matching to ID'S in ForEach
          string itemid2 = task.SUBITEMREF.ToString();
          IList tasks2 = objectSpace.GetObjects(typeof(altMamüller), CriteriaOperator.Parse(@"[ID] = " + itemid2 +" ", TaskStatus.Running));
          if (tasks2 == null) {
              MessageBox.Show("No Items,Please Add Them!");
              return;
          }
          if (tasks2 != null)
          {
              foreach (altMamüller item in tasks2)
              {
                  subitems.Add(item);
              }}}
      //DONE UNTIL HERE
      //Only show "subitems"
      e.View = Application.CreateListView(objectSpace, typeof(altMamüller), true);
  }

As shown with comments, I am creating a listview at bottom of code pile. I want to only show subitems inside this list view.How can I do it?

Upvotes: 0

Views: 37

Answers (0)

Related Questions