07-28-05 12:49 PM
Hi Jarko,
what's wrong with the sort order below?
Sort functions usually take care of your system local. Depending to the
system local different sort orders will be returned.
Btw: this is not a MCMS question. Questions about sorting an Arraylist
should better be placed on an ASP.NET related newsgroup.
Cheers,
Stefan
--
This posting is provided "AS IS" with no warranties, and confers no rights
New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------
"jarkkotv" <jarkkotv@hotmail.com> wrote in message
news:1122543532.598341.130030@o13g2000cwo.googlegroups.com...
Hi!
I have a little problem with the MCMS 2002 and I would appreciate if
someone could help me with this one
I loop through PostingCollection normally. I add each Posting's
Title-HtmlPlaceholder's text into the ArrayList (Placeholder can
contain also Scandic letters). After the loop I try to sort this
Arraylist alphabetically by using the Sort-method, but the ArrayList is
not sorted correctly.
For example: If Title-placeholders contain following letters A,B,C...Å
Result will look like the following: A,Å,B,C...
Does anyone know, what might be the solution for this one?
Thanks a lot!
Jarkko
...first we do something
ArrayList arrList = new ArrayList();
PostingCollection pCol = CmsHttpContext.Current.Channel.Postings;
foreach (Posting pPosting in pCol)
{
PlaceholderCollection phCol = pPosting.Placeholders;
foreach (Placeholder ph in phCol)
{
if (ph.Name.Equals("Title"))
{
HtmlPlaceholder h = pPosting.Placeholders["Title"] as
HtmlPlaceholder;
arrList.Add(h.Text);
}
}
}
arrList.Sort();
for(int i=0; i<arrList.Count; i++)
{
Response.Write(arrList[i]);
}
[ Post a follow-up to this message ]
|