Link to home
Start Free TrialLog in
Avatar of BRowley
BRowley

asked on

Anyone used TMS TAdvListView?

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
Avatar of hammadmajeed
hammadmajeed

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();
Avatar of BRowley

ASKER

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.
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.
ASKER CERTIFIED SOLUTION
Avatar of hammadmajeed
hammadmajeed

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
Avatar of BRowley

ASKER

Thanks, all of you.

regards
B.