Solved

Anyone used TMS TAdvListView?

Posted on 2001-08-20
6
1,741 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month10 days, 1 hour left to enroll

623 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