Im making a user selection userControl for my WPF C# project.
I did make a custom autocomplete control for the selection but for optimization purposes im now looking into using the AutoComplete textbox from the WPF Toolkit.
Since ive got thousands of users in the DB i dont want to use custom classes or to many foreach on the lists im retrieving. So with that in mind here is my problem.
var list = from cu in conn3.customer_users
select new {
username = cu.username,
name = cu.fname.TrimEnd() + " " + cu.lname.TrimEnd()
// This would of course be built with more info from more entities.
};
this.autoComplete.ItemsSource = list.ToList();
Now the problem here is that it outputs the following format for the result box (On a search).
{ username = DEI1231 , name = Missy Anderson }
So i dont want to foreach the list but rather format it as i bind it or as i make the list.
Any ideas?
I didn’t want to hassle more with the beginning space and finally made a decition to just allow the initial space and just strip all spaces from the Meta string eventually anyhow.
The problem actually turns out to be in the event it self so this was by solution for the being. Im not looking anything more into this since in turning over to meta with tags inside the actual message instead. And with a prefix. Eg. @meta
Lets see how that works 😉