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
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
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("Sub Item 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('Sub Item no 1');
lst_item.SubItems.Add('Sub Item no 2');
lst_item.SubItems.Add('Sub Item no 3');
lst_item.SubItems.Add('Sub Item no 4');
lst.Items.EndUpdate();
end;
but nothing appeared on the listview.
Sorry, im gonna have to reject this answer.
regards
B.
lst_item.SubItems.Add("Sub
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
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('Sub
lst_item.SubItems.Add('Sub
lst_item.SubItems.Add('Sub
lst_item.SubItems.Add('Sub
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.
John.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
ASKER
Thanks, all of you.
regards
B.
regards
B.
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("Sub
lst_item.SubItems.Add("Sub
lst_item.SubItems.Add("Sub
lst_item.SubItems.Add("Sub
lst.Items.EndUpdate();