|
|
I need to sort the items in autocompletebox. It has binding to an observable collection of strings.
With a combobox I used the Items.SortDescriptions but this does not work for the ACB.
I tried the following but cant find the listbox property name
//lst = acb1.Template.FindName("SelectionAdapter", acb1) as ListBox;
// if (lst != null)
// lst.Items.SortDescriptions.Add(sd);
So what is the best way to do it please?
|
|
|
|
|
Moonwalker031 wrote: It has binding to an observable collection of strings.
Sort the observablecollection before binding.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Well I tried myobscol.orderby(x=>x) but did not work.
I am adding and removing items from the list during execution so would like an automatic sort instead of sorting manually each time.
|
|
|
|
|
You are manipulating the list "manually" when you insert/remove items, why can't you sort it then.
Do some research on sorting observablecollections.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Ok solved.
When I searched for sorting Observable collection I read that I had to create another copy of the list which I was trying to avoid.
I inserted the line below after adding items to the list. This should not create unnecessary lists.
acb1.ItemsSource = myobscol.OrderBy(x => x);
Back to the first post. What is the name of the Listbox property in the Autocomplete box? I still need this for somthing else.
ListBox lst = acb1.Template.FindName("SelectionAdapter", acb1) as ListBox;
This does not work and gives a null. I tried "ListBox" and "ItemContainerStyle" but still got a null.
|
|
|
|
|
Rather than manipulating your ObservableCollection, take a look at using CollectionViewSource instead. This provides the ability to sort and filter collection items any which way you want.
|
|
|
|
|
Thanks I came across the CollectionViewSource already. But since my project is almost complete and based on Observable collection I didn't want to change everything.
Anyway now the sorting is solved and working properly (see previous post).
|
|
|
|
|
Hi,
In my application on clicking a link i m opening an aspx page in different IE window.Now I want to display "Loading..." on the parent IE window's status bar untill the new window opens when the link is clicked.
|
|
|
|
|
Try HtmlPage.Window.SetProperty("defaultStatus", "Loading..."); .
However, note this is only for IE.
I'm not sure what you need to do for Firefox or other browsers.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
|
You are welcome. Vote or mark as answered if this answer helped though.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
modified on Tuesday, March 15, 2011 8:05 AM
|
|
|
|
|
I'm curious. Why vote the answer? Surely a better indication would be to mark the answer as SOLVED. That's what these forums are about after all.
|
|
|
|
|
Yes. Fair enough.
'Mark as answered' is still relatively new so I keep forgetting about it.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
Abhinav S wrote: 'Mark as answered' is still relatively new so I keep forgetting about it
Fair enough. When you don't ask many questions, but rather spend all your time answering them, it's an easy one to forget.
|
|
|
|
|
I dont know how to use Linq in Silverlight 4.0
I add it into Project.Web but it useless
PLease help me. Thanks
(I dont good at English. But i can read. Thanks )
|
|
|
|
|
You can use LINQ in Silverlight pretty much the same way you use it in C#.
Do you mean LINQ to XML etc?
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
Are you trying to execute a Linq to SQL query from Silverlight? If you are, then you can't do this. What you should do is investigate the RIA services that Silverlight uses - google for Silverlight RIA to get an understanding of how to use them.
|
|
|
|
|
I' curious Pete, do YOU use the RIA services, I don't as I like to roll my own but I'm interested to know if some of the more exprerienced devs here use things like RIA or EF.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I do use RIA and EF. I don't do much with RIA because my primary focus is desktop development, but I've done a fair bit with EF since version 2. V5 looks to be quite decent. While I like to roll my own code, as much as the next man, there comes a point where I have to look at the investment cost and think that using something that somebody else has built may be cheaper. There are lots of factors that go into my decision on that topic.
|
|
|
|
|
I was faced with a similar decision just a few weeks ago regarding POP3 email clients.
I could have written it but it wouldn't benefit from even a percentile of the level of rigorous testing that a £100 commercial solution would provide. Let alone the financial savings over spending a few weeks developing it.
|
|
|
|
|
While I'm more than happy to use 3rd party controls, the whole data/entity layer I feel a need to have complete control of. I first wrote a code generator so my investment in re coding is minimal and I feel I get a better understanding and certainly control of that layer.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Dear All,
I am using SilverLight 4 with Asp.Net 4.0
I am using edmx file in that I have put my required table which have relation in between.
To access these table in MYPage.xaml, I have create service using bellow code
//------------------------------------------------------------------------
public static void InitializeService(DataServiceConfiguration config)
{
// TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc.
// Examples:
config.SetEntitySetAccessRule("Resource_MT", EntitySetRights.All);
config.SetEntitySetAccessRule("ProjectResourceAllocations", EntitySetRights.All);
// config.SetServiceOperationAccessRule("MyServiceOperation", ServiceOperationRights.All);
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
}
//------------------------------------------------------------------------
After that I have create Service Reference.
After this I have create My linq join query.
after this, I want to execute this query.
I am able to execute single table query like
//---------------------------------------------------------------------------------
var dsQueryResource = (DataServiceQuery<ServiceReference2.Resource_MT>)queryResource;
dsQueryResource.BeginExecute(OnResourcesQueryComplete, queryResource);
//---------------------------------------------------------------------------------
But as i have two table which is 1)Resource_MT 2)ProjectResourceAllocations
How can I do this??
As I am very new in Silverlight. Please Help me on this.
For your information here is my LINQ join query
//---------------------------------------------
var queryResource = from p in svcContext2.ProjectResourceAllocations
join r in svcContext2.Resource_MT on p.ResourceID equals r.ResourceID
where p.ProjectID == UserSelectedProjectID
select r.FirstName;
//---------------------------------------------
Waiting for your reply.
|
|
|
|
|
Hi,
I'm trying to learn about creating ribbons through the Microsoft Ribbon Library. I was just wondering if there is a way to use the same icons used in Microsoft Office ribbons? Thank you in advance.
Regards,
Raymond
|
|
|
|
|
Silverlight has a ribbon control [^]that you can always use.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|