Jump to content

TUnimDBList how to use?


Lena

Recommended Posts

Hi.

In MainModule (mobile project):

/FireDAC/

FDConnection1->FDQueryOrgan->DataSetProviderOrgan->ClientDataSetOrgan->DataSourceOrgan

In FDQueryOrgan->SQL:

SELECT * FROM organizations ORDER BY name;

 

In Main Form UnimDBList1:

DataSource= UniMainModule.DataSourceOrgan

DataField=name

 

After press button Enter in Login Form my code in Main Form:

void __fastcall TMainmForm::UnimFormBeforeShow(TObject *Sender)
{
  UniMainModule()->FDQueryOrgan->Active = false;
  UniMainModule()->ClientDataSetOrgan->Active = false;
  UniMainModule()->FDQueryOrgan->Active = true;
  UniMainModule()->FDQueryOrgan->FetchAll();
  UniMainModule()->FDQueryOrgan->First();
  UniMainModule()->ClientDataSetOrgan->Active = true;
  UniMainModule()->ClientDataSetOrgan->Last();
  UniMainModule()->ClientDataSetOrgan->First();
  ShowMessage(IntToStr(UniMainModule()->ClientDataSetOrgan->RecordCount));//<-I see 2
}

Main Form open but UnimDBList1 is empty. :(

How get data in UnimDBList1?

I need to see the data column name (DataField=name) in UnimDBList1.

Please help advice.

v. 1211.

 

P.S. I try to use standart TUniDBLookupListBox/TUniDBLookupComboBox in mobile project but got error.

Link to comment
Share on other sites

  • 2 weeks later...

Hi Kitty.

 

UnimDBList isn't a Grid. It doesn't work like that. It's basically a ListBox. You should fill its items.

 

You can use basic loop to do that. ;)

 

And remember, Because of It's a ListBox, if more than one of same name, add only one is proper use.

 

Or You can use UniDBListGrid. Which is more easier and right way to do that ;)

Link to comment
Share on other sites

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...