Combox and "lookup" values under Firemonkey [Edit]

Hello,

How can I manage this ? :

I have a dataset with ID and Description fields.
I need the records to be displayed in a comboBox. Description need to be displayed. ID should be hidden.

I was able to display these records on a comboBox (using livebindings) but I can't find a way to get my ID value.
I'm doing this rigth now :

Here is how I've set my visual binding :
[BINDSOURCEDB].ID ----> [COMBOBOX].Item.LookupData
[BINDSOURCEDB].Description ----> [COMBOBOX].Item.Text

Here is my code (OnButonClick)

  if Assigned(ComboBox1.Selected) then
  Begin
    if MyDataset.Locate('Description',ComboBox1.Selected.Text,[]) then
     label1.Text = MyDataset.FieldByName('ID').AsString;
  End;

How can I get .Item.LookupData ?
I'm right now doing a locate on my dataset ! This is cumbersome, isn't there another way to get my ID ?

Edited by: Stephane Wierzbicki on Mar 23, 2015 8:03 PM

Edited by: Stephane Wierzbicki on Mar 23, 2015 8:04 PM
0
Stephane
3/23/2015 1:01:01 AM
embarcadero.delphi.firemonkey 4901 articles. 4 followers. Follow

0 Replies
888 Views

Similar Articles

[PageSpeed] 10

Reply:

Similar Artilces:

DataControlRowState is "Edit" or "Alternate, Edit"
In the Gridview RowDataBound event, I check for the state of the row to cast some controls and manipulate with them:Protected Sub gvAutori_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then            If e.Row.RowState = DataControlRowState.Normal Or e.Row.RowState = DataControlRowState.Alternate Then             ...            ElseIf e.Row.RowStat...

"Edit" Vs"Edit Mask"
Are there any potential problems changing a datawindow date field from "edit" to "edit style" and vice versa? I have over 100 datawindows and who knows how many of them have date fields. Question is if I change the edit style from "Edit" to "Edit Mask" of dd/mmm/yyyy. Will this cause any kind of problems? TIA Well we changed ours from editmask to edit (partly because of the large numbers of bugs in edit masks in early builds of PB7, partly because our customers found editmasks unfriendly to use) and it didn't cause any problems. ...

How do I set a home page. Traffic Swarm says just click "edit" then "preferences," but there is no "preferences," under "edit."
Name: Theodore Pong Email: theodorepongatyahoodotcom Product: Firefox Summary: How do I set a home page. Traffic Swarm says just click "edit" then "preferences," but there is no "preferences," under "edit." Comments: How do I set a home page. Traffic Swarm says just click "edit" then "preferences," but there is no "preferences," under "edit." Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16 From URL: http://hendrix.mozilla.org/ ...

.ALLCOL("%COLUMN%", " ", ", ", ", ")
Do you know anyway for me to exclude a subset of columns returned by this function. We have two columns (rec_user and rec_datetime) which are in all of our tables, but when generating triggers I want automatically generate a script which does not include those two columns but does include all other columns in that table. Bruce I should add that I am using PD 9.0.0.580. Bruce "Bruce Lamb" <lamb.bruce@mayo.edu> wrote in message news:6HgI315nCHA.155@forums.sybase.com... > Do you know anyway for me to exclude a subset of columns returned by this > function. ...

Precedence of "where" ("of", "is", "will")?
Nobody on #perl6 today could answer this one. Is: Str | Int where { $_ } the same as: (Str | Int) where { $_ } or: Str | (Int where { $_ }) ? Followup questions, Mr. President: What kind of operators are "where", "of", "is", and "will"? Is there a reason that S03 doesn't list them? What are their precedence(s)? -- Chip Salzenberg - a.k.a. - <chip@pobox.com> Open Source is not an excuse to write fun code then leave the actual work to others. Chip Salzenberg writes: &...

quotes, quotes, quotes...
I am getting this error and I know what is causing it, but I have no idea how to fix it, any help would be great. The script steps through the /var/log/messages file on a linux server and puts The entries into a mysql database. However when it gets to the 'hlt' line in the messages file it just barfs. The single quotes are freaking it out. I know about quotes but not how to use in this situation. Thanks, Paul Error: May 27 17:53:00 localhost kernel: Checking 'hlt' instruction... OK. <----- doesn't like this in the messages file DBD::mysql::st exec...

no "enable editing" "enable deleting" "enable updating"
In my visual studio 2005 beta1,there is no "enable editing", "enable deleting", "enable updating"options. why? is the vision wrong??thanks! Which control are you talking about?/Fredrik Normén - fredrikn @ twitterMicrosoft MVP, MCSD, MCAD, MCTASPInsidersMy Blog "gridview" control!! I have, so you should also have it if you create a data source for the GridView control in the design view and make sure you have specified the Insert and Update Command for the DataSource. You can also add a CommandField to the GridView columns <asp:CommandFi...

[Delphi XE2] "Search projects" missing in "Add to Project" dialog box [Edit]
"Search projects" missing in "Add to Project" dialog box when using windows classic theme (windows 7 64bits). Notepad on the contrary still have the "Seacrh ..." box in its open file dialog. Check the images below(they are not mine but show the issue) This one does have the "search document" box in the upper right corner. http://img98.imageshack.us/img98/9518/dialog2.png This one does not have it. http://img291.imageshack.us/img291/4793/dialogl.png Any help on this matter will be greatly appreciated. ...

Change from Edit Style "Edit" till "DropDownDW" at runtime
Is it possible to change the edit style from "Edit" till "DropDownDW" at runtime? I want a DropDownDataWindow to appear when in query-mode only. How do I do it ? Thanks for any help! Turid Have you tried to use the Modify command? I didn't look up the syntax for this but it would be something like : dw_1.Modify("column_name.dddw.Name='d_list'") dw_1.Modify("colun_name.dddw.DataColumn='list_id'") You will need to GetChild() on "column_name" to retrieve the list but I'm sure you get the idea. HTH Turi...

"To" and "From" missing
When I print emails, the words "To" and "From" are blank, even though the "To" name and "From name (addresser, addressee) do show up. This is not a problem for other users on my system. Suggestions In mailbox right click, view. On the message window, right click and choose print options. Make sure print header is checked. -- Barry Merchant NSC Volunteer SysOp *** no email unless requested please!! *** > In mailbox right click, view. On the message window, right click and > choose print options. Make sure prin...

replace the "." with a ","
Oi.... I need to build a small programm in ASP.NET and chose to use C# for it.Now i got everything working but there's one little problem.the first textbox is a double. I need to make it so that when someone enters a "." then it gets replaced by a ","any ideas?Ghan  string blah = "4.2.2.2";blah = blah.Replace(".", ",");Ryan Ryan OlshanASPInsider | Microsoft MVP, ASP.NEThttp://ryanolshan.comHow to ask a question...

"Me" is better than "You"
Yes I know, strings are frozen. But let me talk about it, I really can't get through the idea of a PC talkin to me. I consider my PC as an extension of myself, not a dumb companion who addresses Me as You. Yes there are times when I get angry with Him while I work and get wrong calculations etc.., but it really is my fault, Me using wrong istructions and eventually wanting to find someone else to blame, but it's Me. And yes, I consider Thunderbird my mail program, reading my mail on my PC as Me. So I personally like to have Me in the header bar as a compact address ...

double quote
hello there...  i tried everything of think but not working the way i wanted to be... not sure what i'm missing...i'm generating a <span> in code behind and then using in javascript.... here is what i'm doing code behind: int i=0string _keywordID = "keyword";string _name = row["visit_info_nm"].ToString().Trim(); String _getElementByID = String.Format("<span id='{0}' OnClick = \"document.getElementById('{1}').value='{2}';\">{3}</span><br>", i, _keywordID, _name, _name); here is what it generate : <span id='1' OnClick = \"document.getElementById('keyword')...

Replacing "\\" with "\"
Hi all I'm getting this value from a CheckBoxList control - a location of file, i have to remove "\\" and replace it with "\" and pass it to Query, how to do it, i tried with Replace, but coud'nt suceed. "\\\\Blaze10xp\\BLZ_SFS_07\\Sample Excel Files\\Excel Files\\report2.xls" thank's in advance - Prakash.C you tried Replace like this? string newstring = oldstring.Replace(@"\\",@"\");Plese, do not forget to click "Mark as Answer" on the post that helped you. Thanx!My blog: Scenes From A Developer Memory yes i tr...

Web resources about - Combox and "lookup" values under Firemonkey [Edit] - embarcadero.delphi.firemonkey

Resources last updated: 1/18/2016 5:16:43 PM