Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Prism Array of String als ListViewItem? (https://www.delphipraxis.net/72748-array-string-als-listviewitem.html)

ZeroQool007 6. Jul 2006 08:46


Array of String als ListViewItem?
 
Hallo, habe bereits gesucht, aber die anderen Threads waren nicht genau das was ich gesucht habe.


Folgender C# Code
Zitat:

ItemTypeCollection sellerlist = apicall.GetSellerList();

foreach (ItemType item in sellerlist)
{
string[] listparams = new string[6];
listparams[0] = item.ItemID;
listparams[1] = item.Title;
listparams[2] = item.SellingStatus.CurrentPrice.Value.ToString();
listparams[3] = item.SellingStatus.QuantitySold.ToString();
listparams[4] = item.SellingStatus.BidCount.ToString();

if (item.BestOfferDetails != null)
listparams[5] = item.BestOfferDetails.BestOfferEnabled.ToString();
else
listparams[5] = "False";


ListViewItem vi = new ListViewItem(listparams);
LstItems.Items.Add(vi);

Den möchte ich nun in Delphi haben.

Delphi-Quellcode:
   for ItemTypeInstanz in ItemTypeCollectionInstanz do
   begin
     ListViewArray[0] := ItemTypeInstanz.ItemID;
     ListViewArray[1] := ItemTypeInstanz.Title;
     ListViewArray[2] := ItemTypeInstanz.SellingStatus.CurrentPrice.Value.ToString();
     ListViewArray[3] := ItemTypeInstanz.SellingStatus.QuantitySold.ToString();
     ListViewArray[4] := ItemTypeInstanz.SellingStatus.BidCount.ToString();

     if ItemTypeInstanz.BestOfferDetails <> NIL then
     begin
       ListViewArray[5] := ItemTypeInstanz.BestOfferDetails.BestOfferEnabled.ToString();
     end else
     begin
       ListViewArray[5] := 'False';
     end;

   end;

Mein Problem ist dieser CodeTeil
Zitat:

ListViewItem vi = new ListViewItem(listparams);
LstItems.Items.Add(vi);
[/quote]

Weiß jemand wie ich den in Delphi hinbekomme? Danke im voraus


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:03 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz