Jump to content

Recommended Posts

Posted

Hello everybody,

    I want to show my data in a TTreeDBGrid or TuniTreeDBGrid.But I can not find the component.Do you have the component to meet my need?

    Or can you give me some advices?

   Thank you very much.

Posted

Hi Delphi Developer,

   I see the your samples,but I still know how to use in uniGUI,Would you give me more informations or samples using the js in uniGUI?

 

Thanks

Posted

This code works for me.

try to adapt it.

You must create a table like: Id, Description, IdFather

hope that helps.
procedure CreateTreeViewFromTable;
var iFather, iLast: TUniTreeNode; FatherCreated: Integer;
begin
  Qry.First;
  FatherCreated := -1;
  while not Qry.Eof do
  begin
    if (FatherCreated <> QryIDFather.AsInteger) then
    begin 
      if QryID.AsInteger = QryIDFather.AsInteger then
        iFather := TreeView1.Items.Add(nil, QryDESCRIPTION.AsString)
      else
        iFather := TreeView1.Items.AddChild(iLast, QryDESCRIPTION.AsString);
      FatherCreated := QryID.AsInteger;
      Qry.Next;
    end
    else
    begin
      while (not Qry.Eof) and (FatherCreated = QryIDFather.AsInteger) do
      begin
        iLast := TreeView1.Items.AddChild(iFather, QryDESCRIPTION.AsString);
        Qry.Next;
      end;
    end;
  end;
end;

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...