MCMS 2002 - Sort Placeholder Content in ArrayList
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > MCMS 2002 - Sort Placeholder Content in ArrayList




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    MCMS 2002 - Sort Placeholder Content in ArrayList  
jarkkotv


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-28-05 12:49 PM

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...=C5
Result will look like the following: A,=C5,B,C...

Does anyone know, what might be the solution for this one?

Thanks a lot!

Jarkko


.=2E.first we do something

ArrayList arrList =3D new ArrayList();
PostingCollection pCol =3D CmsHttpContext.Current.Channel.Postings;
foreach (Posting pPosting in pCol)
{
PlaceholderCollection phCol =3D pPosting.Placeholders;
foreach (Placeholder ph in phCol)
{
if (ph.Name.Equals("Title"))
{
HtmlPlaceholder h =3D pPosting.Placeholders["Title"] as
HtmlPlaceholder;
arrList.Add(h.Text);
}
}
}
arrList.Sort();

for(int i=3D0; i<arrList.Count; i++)
{
Response.Write(arrList[i]);
}






[ Post a follow-up to this message ]



    Re: MCMS 2002 - Sort Placeholder Content in ArrayList  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Re: MCMS 2002 - Sort Placeholder Content in ArrayList  
jarkkotv


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-28-05 12:49 PM

Thanks Stefan!

Yes, I know that this not the actual MCMS-problem, but I was just
wondering if someone working with the MCMS have had the same kind of
problems 

I'll try some one other ASP.NET newsgroup.

Jarkko

PS: Thanks for the many useful tips you have given to us MCMS-people 






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:53 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register