Home All Groups Group Topic Archive Search About

Lookup table in a Label

Author
13 Jul 2006 4:12 PM
Ryan
I have a form that contains a field that is a Foreign Key (UserID)
I want this control to have a "label" appearance but I want it to act as a
lookup table (SelectedValue = FKID, SelectedText = "Joe Blow").  Using a
ComboBox control is the only way I've found to do this (and its actually
really easy) but I haven't found a way to disable everything and make that
combo box just look like a standard label.  The label control doesn't seem
to have any of the data binding I need.

Thanks,
Ryan

Author
14 Jul 2006 12:49 AM
Walter Wang [MSFT]
Hi Ryan,

Thank you for your post.

Based on my understanding, your question is how to bind a Label to data
source and have it show the text with a field, while saving another field
in its state which will be used to lookup other data. If I've misunderstood
anything, please feel free to post here.

In VS2005, you can use Label's built-in databinding feature to do this:
1) Add a Label, open its properties window
2) Look for "(DataBindings)", expand it, click the "..." of "(Advanced)",
this will open its databinding dialog
3) In the "Common" category, there're two properties, "Text" will be used
to display a field that user can see, for example "UserName"; "Tag" will be
used to store another field can be used to lookup, for example "UserID".

Hope this helps. Please feel free to post here if anything is unclear.

Regards,
Walter Wang (waw***@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Author
14 Jul 2006 2:39 PM
Ryan
Walter,

Thanks I was wondering if the Tag databinding was what I was looking for.
Looks like it is.

Ryan

Show quoteHide quote
"Walter Wang [MSFT]" <waw***@online.microsoft.com> wrote in message
news:p3L3i9tpGHA.5392@TK2MSFTNGXA01.phx.gbl...
> Hi Ryan,
>
> Thank you for your post.
>
> Based on my understanding, your question is how to bind a Label to data
> source and have it show the text with a field, while saving another field
> in its state which will be used to lookup other data. If I've
> misunderstood
> anything, please feel free to post here.
>
> In VS2005, you can use Label's built-in databinding feature to do this:
> 1) Add a Label, open its properties window
> 2) Look for "(DataBindings)", expand it, click the "..." of "(Advanced)",
> this will open its databinding dialog
> 3) In the "Common" category, there're two properties, "Text" will be used
> to display a field that user can see, for example "UserName"; "Tag" will
> be
> used to store another field can be used to lookup, for example "UserID".
>
> Hope this helps. Please feel free to post here if anything is unclear.
>
> Regards,
> Walter Wang (waw***@online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
>
> ==================================================
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
Author
16 Jul 2006 11:09 AM
Walter Wang [MSFT]
Hi Ryan,

Thank you for your update. Please feel free to post here if anything is
unclear.

Have a nice day!

Regards,
Walter Wang (waw***@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.