ListView Groups AnzeigeProblem



  • Hallo,

    Ich habe folgendes Problem. Ich habe in einer MDI-Anwendung in einem MDI-Child ein ListView das ich wie folgt füllen lasse

    LVSymbols->Clear();
      LVSymbols->Groups->Clear();
      LVSymbols->Items->Clear();
    
      LVSymbols->SmallImages = SmallImages;
      LVSymbols->LargeImages = SmallImages;
      LVSymbols->GroupHeaderImages = SmallImages;
      LVSymbols->ViewStyle = vsIcon; //vsSmallIcon;
    //  LVSymbols->GroupView = true;
    
      TListItem *listItem;
      TListGroup *group;
    
      int GroupIDHintergrund;
      int GroupIDAllgemein;
      int GroupIDSymbole;
    
      group = LVSymbols->Groups->Add();
    //  group->ID = 0;
      group->Index = 0;
      group->State << lgsNormal;// << lgsCollapsible;
      group->Header = "Hintergrund";
      group->HeaderAlign = taLeftJustify;
      group->Footer = "Hintergrund";
      group->FooterAlign = taLeftJustify;
      group->Subtitle = "Hintergrund";
      group->TitleImage = -1;
      GroupIDHintergrund=  group->GroupID;
    
      group = LVSymbols->Groups->Add();
    //  group->ID = 1;
      group->Index = 1;
      group->State << lgsNormal;// << lgsCollapsible;
      group->Header = "Allgemein";
      group->HeaderAlign = taLeftJustify;
      group->Footer = "Allgemein";
      group->FooterAlign = taLeftJustify;
      group->Subtitle = "Allgemein";
      group->TitleImage = -1;
      GroupIDAllgemein=  group->GroupID;
    
      group = LVSymbols->Groups->Add();
    //  group->ID = 2;
      group->Index = 2;
      group->State << lgsNormal;// << lgsCollapsible;
      group->Header = "Symbole";
      group->HeaderAlign = taLeftJustify;
      group->Footer = "Symbole";
      group->FooterAlign = taLeftJustify;
      group->Subtitle = "Symbole";
      group->TitleImage = -1;
      GroupIDSymbole=  group->GroupID;
    
    	// add a new item to the list view
      listItem = LVSymbols->Items->Add();
      listItem->Caption = "Farbe";
      listItem->ImageIndex = 0;
      listItem->GroupID = GroupIDHintergrund;
      listItem = LVSymbols->Items->Add();
      listItem->Caption = "Bild";
      listItem->ImageIndex = 1;
      listItem->GroupID = GroupIDHintergrund;
    
    	// add a new item to the list view
      listItem = LVSymbols->Items->Add();
      listItem->Caption = "Systemadresse";
      listItem->ImageIndex = 2;
      listItem->GroupID = GroupIDAllgemein;
      listItem = LVSymbols->Items->Add();
      listItem->Caption = "Sprungmarke";
      listItem->ImageIndex = 3;
      listItem->GroupID = GroupIDAllgemein;
      listItem = LVSymbols->Items->Add();
      listItem->Caption = "Text";
      listItem->ImageIndex = 4;
      listItem->GroupID = GroupIDAllgemein;
    
    	// add a new item to the list view
      listItem = LVSymbols->Items->Add();
      listItem->Caption = "Lüfter";
      listItem->ImageIndex =5;
      listItem->GroupID = GroupIDSymbole;
      listItem = LVSymbols->Items->Add();
      listItem->Caption = "Rohr";
      listItem->ImageIndex = 6;
      listItem->GroupID = GroupIDSymbole;
    
      LVSymbols->GroupView = true;
    

    Führe ich diesen Code in einem anderen Formular, Projekt, ect. aus erhalte ich schön meine Gruppen mit den Unterpunkten.
    Auch wenn ich eine MDI-Anwendung erstelle und in einem Child das hier ausführe funktioniert es.

    Nur in meinem bestehenden Programm (MDI-Anwendung) habe ich nachdem ausführen meine Einträge aber keine Anzeige der Gruppen.
    Ich habe das auch schon direkt im Objekt eingetragten, also über den Objektinsprektor. Aber auch dann wird beim Anzeigen des MDI-Childformulars keine Gruppe mit angezeigt.Also wie wenn

    GroupView = false
    

    und als

    Style vsIcon
    

    Gibt es noch andere Abhängigkeiten der "GroupView" außer vom selbigen Property? einstellung des Formulars?



  • So habe nach etlichen Versuchen und Umstellungen meinen "Fehler" gefunden.
    In meinem "Problemprogramm" musste ich lediglich die Komponente "XPManifest" hinzufügen und erhielt auch dort die Groupsanzeige.

    Problem gelöst.


Anmelden zum Antworten