Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Application Help

  Asked By: Tim    Date: Mar 05    Category: Sharepoint    Views: 540

We have a Master Activities Calendar on a WSS site under our Enterprise Portal. I was asked to display selected Events from that Calendar on the Portal Home page. I added a 'Yes/No' field to each item and named it Front Page Item. The Managers who administer the Calendar check the items they want to display on the Portal Home page. I wrote an application that loops through the Calendar and if the item is marked for the front page and the event date is eaual to or greater than today the Title of the event linked to the item shows on the front page. Works great but the only problem is that items are displayed on the front page in the order that they were created in the calendar. This means that if the Christmas Party on 23 Dec was posted to the calendar in January of this year and the Octoberfest on 1 October was posted to the calendar in May of this year, the Christmas Part will be listed first before the Octoberfest.

Should I save the appropriate events in a temp table and then sort the table based on Event Date then display the events from the table?



3 Answers Found

Answer #1    Answered By: M Juarez     Answered On: Mar 05

selected  the items  from the list and put them into a DataTable and then created  a DataView for the table  and sorted the DataView. Then I used the DataView to display  the items. Below is the meat of the code:

dRowItem2 = tmpTable.NewRow()

dRowItem2("ID") = listItem("ID").ToString()

dRowItem2("Title") = listItem("Title").ToString()

dRowItem2("Begin") = CDate(listItem("Begin"))



End If

End If

End If


Next j

Dim dv As DataView

Dim ds As DataSet

dv = New DataView(tmpTable)

dv.Sort = "Begin"

'Response.Write("<br />")


For k = 0 To dv.Count - 1

Response.Write("<span style='font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 8pt;font-weight: bold;'>")

Response.Write("<img src='/_layouts/images/ball_glass_blueS.gif' alt='*' /><a href='/sites/cmdcal/lists/Events/DispForm.aspx?ID=")

Response.Write(SPEncode.HtmlEncode(dv.Item(k).Row.Item("ID").ToString()) & "' target='_blank'>")

Response.Write(SPEncode.HtmlEncode(dv.Item(k).Row.Item("Title").ToString()) & "</a> </span><span style='font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 8pt;'>")

Response.Write(SPEncode.HtmlEncode(dv.Item(k).Row.Item("Begin").ToString()) & "</span><br />")

Next k

Answer #2    Answered By: Marty Mcdowell     Answered On: Mar 05

So what is the problem  you are having? I did not see a previous post regarding this topic.

Answer #3    Answered By: Dakota Shaffer     Answered On: Mar 05

No problem. I asked  about sorting items  that had been extracted from a Master Activities Calendar list on a WSS team site  to show on the portal  Home page. I was just posting what I ended up doing.

Didn't find what you were looking for? Find more on Application Help Or get search suggestion and latest updates.