Mattersphere Developers Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
Heather@FootAnstey
Posts : 57
Join date : 2018-12-19

How to bind a SearchList's DataBuilder to a List<T> Empty How to bind a SearchList's DataBuilder to a List<T>

Fri 17 Apr 2020 - 14:59
Original Post: Michael Lawton 19/09/2013 03:31:18

"Hi All,
I have a collection of .net type List<StreetAddress> that I need to display in a SearchList. The StreetAddress class would have properties like StreetName, Suburb and these should be displayed as the SearchList columns . Is it possible to set the searchlist's databuilder to a List<T> likeList<StreetAddress> ?
Thanks Michael Lawton
SLATER & GORDON LAWYERS"

Responses:

technical 19/09/2013 12:31:06
"A while ago i wanted to do something very similar, getting objects into a searchlist so you can use its/the functionality for searching. At the time i didnt succeed but your question reminded me and i had an idea.
Basically if you could serialize the object and pass it as a parameter you could use the XML SQL type to query and output the data to the SearchList in the databuilder. I've had a go and it seems to work.
In the Databuilder i created a Parameter and set it to XML Type. I the query i used the Nodes method to separate each object in the collection and then the value method to get the value of the elements inside.

On the Screen i used the follow below code to serialize the list and pass the xml to the searchlist. I realise its probably not quite what you where after but might help someone along the way.
Phil"

Michael Lawton 20/09/2013 00:43:44
"Thank you Phil, very nice solution ! I'll give it a try. Michael"

RichardA 24/09/2013 10:06:04
"Hi Michael,
It's possible to bind a searchlist to any static method that returns a datatable. So you could create an assembly with a method that accepts List<StreetAddress> and returns it as a datatable. Then whenever you call the searchlist pass your List in the keyvaluecollection you pass to the seachlist.
SCHCLIADDFIELDS is an example using this method. If you examine it you will see the Source Type = Class and the source the name of the class that contains the method. In V5 the assembly just needs to be in your distributed assembly before V5 you'll have to put the assembly in the matter centre program files directory for it to be found.
Regards Rich"

Michael Lawton 26/09/2013 01:39:43
"Thanks very much Richard. I'll pass this on to the rest of the team. Michael"
Back to top
Permissions in this forum:
You cannot reply to topics in this forum