Solved

Anyone used TMS TAdvListView?

Posted on 2001-08-20
6
1,646 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Accepted Solution

by:
hammadmajeed earned 50 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks, all of you.

regards
B.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now