• Page:
  • 1

TOPIC: TListView Footer Text Live Bindings

TListView Footer Text Live Bindings 7 months 5 days ago #13539

I have not been able to use Live Bindings to connect a Data Generator source field to the Text property of a TListView Footer. This is because I can't seem to locate a Live Bindings entry for the TListView item.

Can someone explain to me how this operates?

Please Log in or Create an account to join the conversation.

TListView Footer Text Live Bindings 6 months 3 weeks ago #13619

Hello,
As you, I don't see how to do such thing with livebindings, only for headers !
So i use some tricks( not academic but ....) to fill these footers
...
 private 
    i : Integer;
...
// using a dynamic appearence , 2 text in item 

procedure TForm13.LinkListControlToField1FilledList(Sender: TObject);
var Pied,Temp : TListViewItem;
    texte : String;
    Li : integer;
begin
    // moving footer up 
     for Li := 1 to Pred(ListView1.ItemCount) do
     begin
       if ListView1.Items[Li].Purpose=TListItemPurpose.Footer then
         begin
           Pied:=ListView1.Items[Li];
           Texte:=Pied.Text;
           ListView1.Items.Delete(Li);
           Temp:=ListView1.Items.Insert(Li-1);
           temp.Text := Texte;
           temp.Purpose := TListItemPurpose.Footer;
         end;
     end;
 // last "record" 
  with ListView1.Items.Add do
    begin
      Text := Format('Last footer %d',[i]);
      Purpose := TListItemPurpose.Footer;
    end;
end;

procedure TForm13.LinkListControlToField1FilledListItem(Sender: TObject;
  const AEditor: IBindListEditorItem);
var AnItem, FItem : TListViewItem;
begin
AnItem:=AEditor.CurrentObject as TListViewItem;
if (AnItem.Purpose=TListItemPurpose.Header) then
 begin
  if (AnItem.Index>1)  then
   begin
      with ListView1.Items.Add do
       begin
          Text := Format('bloc footer %d',[i]);
          Purpose := TListItemPurpose.Footer;
         // to be moved later
     end;
    end;
  i:=0;
 end
 else  i:=i+StrToInt(AnItem.Data['Text2'].AsString);
end;

Hope there is another way to do that sort of thing but this trick works
Attachments:

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Moderators: April Anne