Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Anyone used TMS TAdvListView?

Posted on 2001-08-20
6
Medium Priority
?
1,795 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
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 150 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Loops Section Overview
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

885 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