Solved

Anyone used TMS TAdvListView?

Posted on 2001-08-20
6
1,687 Views
Last Modified: 2008-03-17
Hi

Ive just been looking at www.tmssoftware.com and found a component TAdvListView. Theres so much in there im having problems trying to get a grips with it. All I want to do is add items with about 5 columns :)

What im asking is has anyone ever used this component and if so could I have the .pas file to see how to use it please.

Many thanks
BarryR
0
Comment
Question by:BRowley
6 Comments
 

Expert Comment

by:hammadmajeed
ID: 6407096
hi,
Here is the solution
if u still have any problems do let me know. Name of the TAdvListView is "lst" in this example;

TListItem *lst_item;
lst.Items.BeginUpdate();
lst.Items.Clear(); //clears the items
lst_item = lst.Items.Add(); //new item is added
lst_item.ImageIndex = 0; //sets the image for the item
lst_item.Caption = "Major Caption";
lst_item.SubItems.Add("SubItem no 1");
lst_item.SubItems.Add("SubItem no 2");
lst_item.SubItems.Add("SubItem no 3");
lst_item.SubItems.Add("SubItem no 4");
lst.Items.EndUpdate();
0
 

Author Comment

by:BRowley
ID: 6408884
Thanks for the code but it didnt work. All types of problems with it. if you dont mind me saying, simple stuff like setting strings wrong e.g.

lst_item.SubItems.Add("SubItem no 1");

and the difference between = and :=
e.g.

lst_item.Caption = "Major Caption";


I tried to modify what you wrote to get this:

procedure TForm1.Button1Click(Sender: TObject);
var
lst_item :TListItem;
begin
//TListItem *lst_item;
lst.Items.BeginUpdate();
lst.Items.Clear(); //clears the items
lst_item := lst.Items.Add(); //new item is added
lst_item.ImageIndex := 0; //sets the image for the item
lst_item.Caption := 'Major Caption';
lst_item.SubItems.Add('SubItem no 1');
lst_item.SubItems.Add('SubItem no 2');
lst_item.SubItems.Add('SubItem no 3');
lst_item.SubItems.Add('SubItem no 4');
lst.Items.EndUpdate();

end;

but nothing appeared on the listview.
Sorry, im gonna have to reject this answer.
regards
B.
0
 
LVL 6

Expert Comment

by:Jaymol
ID: 6408987
Barry, have a word with a mate of mine - Smurff - I know he's used this component suite and he's an expert coder.

John.
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 

Accepted Solution

by:
hammadmajeed earned 50 total points
ID: 6409226
ok sorry for the above code, that was originally written for c builder. anyways here is the pas code. The reason u r not able to see the newly added item is the ViewStyle property of the list view. if it is "VsReport" then u have to add 5 columns at the design time, after that u will be able to add new items. or simply chnage the ViewStyle  property to anything but "vsReport". Hopefully this will solve ur problem. Also drop a imagelist component on the form and add couple of images to it, if u want to see the images associated with each item u add. dont forget to specify the name of the image list u just added to the SmallImages property of the list view,

unit populate_listview;
interface
uses Windows,Messages,Classes,ComCtrls,AdvListV;
procedure PopulateListView(list:TAdvListView);
implementation
var newListItem:TListItem;
procedure PopulateListView(list:TAdvListView);
begin
   newListItem := TListItem(list.items);
   newListItem := list.Items.Add;
   newListItem.Caption := 'Main Caption';
   newListItem.ImageIndex := 0; //setting of image to the list item
   newListItem.SubItems.Add('Sub Item no 1'); //adding subitems to the list view
   newListItem.SubItems.Add('Sub Item no 2');
   newListItem.SubItems.Add('Sub Item no 3');
   newListItem.SubItems.Add('Sub Item no 4');
end;
end.


Hammad.
0
 
LVL 3

Expert Comment

by:smurff
ID: 6409524
hammadmajeed you shouldnt be really posting as an Answer.

Use the first part of hammadmajeeds last comment but the code I have is :

procedure init;
begin
  with AdvListView1 do
  begin
    with Items.Add do
    begin
      Caption:='<b>TAdvEdit</b>';
      SubItems.Add('D2 D3 D4 D5 D6');
      SubItems.Add('Aug 20, 2001');
      SubItems.Add('<a href="http://www.tmssoftware.com/advedit.htm">View</a>');
      SubItems.Add('Data aware and non data aware edit control with lots of features including focus color, error color, attached label, validated input ... ');
    end;
end;


Remember for each subitem there has to be a column defined in design time.
I will admit its a bit of a pain to get to grips with but its quite a good looking comp.

regards
Smurff
0
 

Author Comment

by:BRowley
ID: 6412999
Thanks, all of you.

regards
B.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question