Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Anyone used TMS TAdvListView?

Posted on 2001-08-20
6
Medium Priority
?
1,766 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
Technology Partners: 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!

 

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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

719 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