locked
Show BusinessEntityCollection in Gridview RRS feed

  • Question

  • I'm currently working on a custom page that should display crm activities in a Grid View. I have managed to bind the retrieved business entities to the grid, but the only text showing in the grid is the values of type "string". Look up fields and activityparty-fields show up as blank spaces.

    Is there a way to display  lookup or activityparty values in a gridview?

    -Stian-
    Monday, July 28, 2008 12:09 PM

Answers

  • You should transfer data to a datatable first. And then bind datatable to the gridview. If you bind businessentitycollection directly, as yo say you will see just string fields. In a foreach loop, you can transfer all data in the datatable and get values from lookup fields as [lookupfield].name, [lookupfield].Value.

     

    Regards.

    Monday, July 28, 2008 1:45 PM

All replies

  • You should transfer data to a datatable first. And then bind datatable to the gridview. If you bind businessentitycollection directly, as yo say you will see just string fields. In a foreach loop, you can transfer all data in the datatable and get values from lookup fields as [lookupfield].name, [lookupfield].Value.

     

    Regards.

    Monday, July 28, 2008 1:45 PM
  • Ok, I'm trying to do something similar. The thing is that I need the contactid, and in the gridview it shows a crm..guid... something like that. But I need the key, cause I want that the user click in the name for example, and open other aspx where show the details. How can I do that, create a datatable and all you say. Can you give a little example.
    Thank you very much.
    Wednesday, October 8, 2008 7:11 PM