Jump to content


NEXTDBGrid LookUp HAS A BUG


  • Please log in to reply
2 replies to this topic

#1 jrag1976

jrag1976
  • Members
  • 6 posts

Posted 21 December 2006 - 04:45 AM

WHEN I USED THE DBLOOKUP COMOBO BOX ON A NEXTDBGRID IT DOESN'T LOOK FOR THE KEYID OF THE TABLE IT LOOKS FOR THE NAME INSTEAD, WHAT IF I HAVE TO DUPLICATE NAMES. BUT I'VE REPROGRAMED DE CODE SO IT CAN RETREIVE THE CORRECT RECORD WITH THE KEY AND ALSO RETURN THE KEY VALUE OF THAT RECORD. YOU SOULD FIX THIS BUG. AND I HAVE ALSO FIX A LOT OF OTHER BUGS.

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 6,685 posts
  • Gender:Male

Posted 21 December 2006 - 06:18 AM

Hello,

It is designed to work that way, I only can add a option to look for key too.

I am working on every bug, and lot of them are already fixed long ago. There allways some smaller and hidden bugs that are hard to find.
boki@bergsoft.net
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 rond

rond
  • Members
  • 50 posts
  • Location:Lieshout, The Netherlands

Posted 14 February 2011 - 12:26 PM

QUOTE (Boki (Berg) @ Dec 21 2006, 06:18 AM) <{POST_SNAPBACK}>
Hello,

It is designed to work that way, I only can add a option to look for key too.

I am working on every bug, and lot of them are already fixed long ago. There allways some smaller and hidden bugs that are hard to find.

Hi,
I just noticed this bug-report for the Lookup-control.

As a temporary solution I am using a standard combobox with the 'key value' assigned to the objects in the itemlist of the control.

Example :
- set the column to 'DbComboboxColumn', fieldname set to 'name'
- create a query for the list you want to use and fill the items-property like this :
While not MyListQuery.Eof do
begin
  iName := MyList.Query.FieldByName('Name').AsString;
  iKey    := MyList.Query.FieldByName('Id').AsString;
        colProductName.Items.AddObject(       iName, TObject(iKey));
end;

- add an event to the 'onselectEvent' to set the value in your table.
CODE

  if Sender is TNxDBComboBoxColumn then
  begin
    iColumn := Sender as TNxDBComboBoxColumn;

    iIndex := TNxComboBox(iColumn.Editor).ItemIndex;
    if(iIndex > -1) then
    begin
      iForeignKeyValue := integer(iColumn.Items.Objects[iIndex]);
      // save this value to the field you want in your table
    end;
  end;






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users