Show lookup description data in a grid or listview


Author
Message
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi,

I am working on a form with a grid or listview which will show data from a related table as a lookup and I would like to show a descritive fields instead of the Foreing Key field value, how can I do this?

In the picture attached, the FK_Appliances in the Grid or Appliance in the List View are the ones I want to show the descriptive field instead of the FK value.

Also, since I am learning SF, I found that the creation of a ListView is a bit difficult than using a GridView for read only data, is there a way to show the grid with empty columns like in the ListView in order to cover the gray area of the grid?

Thanks!

Edhy Rijo

Reply
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Trent,

After a second thought, I decided to try Tim's suggestion to create a Custom Property and after reading Tim's great sample and with the SF help file, I could not believe how easy it was to have 2 Custom Field Properties to handle this situation and not have to add a single line of code at the form level, which keep the things simple.

For the sake of new SF users, here is the code for one of my Custom Field Properties:

''' <summary>

''' This property will return a formatted Building Address

''' </summary>

''' <remarks></remarks>

<Browsable(False), _

BusinessFieldDisplayInEditor(), _

Description("CustomerBuildingAddress"), _

DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _

Public ReadOnly Property [CustomerBuildingAddress]() As System.String

     Get

          Dim loBusinessObject As New BuildingsBO

          loBusinessObject.FillByPrimaryKey(Me.FK_Buildings)

          If loBusinessObject.Count = 1 Then

               Return String.Format("{0}, {1} {2} {3}", loBusinessObject.Street, loBusinessObject.City, loBusinessObject.State, loBusinessObject.Zip)

          Else

               Return String.Empty

          End If

          ' Release the Business Object

          loBusinessObject.Dispose()

     End Get

End Property

Once again, big thanks to Tim and Trent for the lecture on how to accomplish this task. Hehe

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Edhy Rijo - 18 Years Ago
Tim Dol - 18 Years Ago
Trent L. Taylor - 18 Years Ago
Edhy Rijo - 18 Years Ago
Edhy Rijo - 18 Years Ago
Trent L. Taylor - 18 Years Ago
                         [quote][b]Trent L. Taylor (11/07/2007)[/b][hr] I don't know if you...
Edhy Rijo - 18 Years Ago
                             Hi Trent, In a Browser Dialog, I need also to show a descriptive field...
Edhy Rijo - 18 Years Ago
                                 Look real close at your code ;) With CType (e.BusinessObject,...
Trent L. Taylor - 18 Years Ago
                                     Hi, Sorry about that, it was a copy/paste problem, here is the...
Edhy Rijo - 18 Years Ago
                                         It sounds like you do not have the column setup as...
Trent L. Taylor - 18 Years Ago
                                             Hi Trent, After a second thought, I decided to try Tim's suggestion to...
Edhy Rijo - 18 Years Ago
StrataFrame Team - 18 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search