locked
Grouping in Dataview Webpart RRS feed

  • Question

  •  

    I need to customise the Event Calendar in a dataview webpart. I have grouped the events based on Event Date( MM/DD DAY Format) . Grouping works well.

    Now, I would like to Show only 2 Groups ( 2 upcoming event dates ) . I would like to list out all the events come under those 2 event dates. How to approach this challenge?

    Please refer the code below for reference:

     

    <WebPartPages:DataFormWebPart runat="server" Description="" PartOrder="2" HelpLink="" AllowRemove="True" IsVisible="True" AllowHide="True" UseSQLDataSourcePaging="True" ExportControlledProperties="True" DataSourceID="" Title="Events Calendar" ViewFlag="8" NoDefaultStyle="TRUE" AllowConnect="True" FrameState="Normal" PageSize="-1" PartImageLarge="" AsyncRefresh="False" ExportMode="All" Dir="Default" DetailLink="" ShowWithSampleData="False" ListId="525ad826-7bd9-486a-8029-bb60d09fd119" ListName="{525AD826-7BD9-486A-8029-BB60D09FD119}" FrameType="TitleBarOnly" PartImageSmall="" IsIncluded="True" SuppressWebPartChrome="False" AllowEdit="True" ManualRefresh="False" ChromeType="TitleOnly" AutoRefresh="False" AutoRefreshInterval="60" AllowMinimize="True" ViewContentTypeId="" InitialAsyncDataFetch="False" MissingAssembly="Cannot import this Web Part." HelpMode="Modeless" ListUrl="/Lists/Events/" ID="g_86943d3d_2bb7_4c3b_9304_e33f8dfe5d80" ConnectionID="00000000-0000-0000-0000-000000000000" AllowZoneChange="True" IsIncludedFilter="" __MarkupType="vsattributemarkup" __WebPartId="{86943D3D-2BB7-4C3B-9304-E33F8DFE5D80}" __AllowXSLTEditing="true" WebPart="true" Height="" Width=""><ParameterBindings>
          <ParameterBinding Name="ListName" Location="None" DefaultValue="Events"/>
          <ParameterBinding Name="WebID" Location="None" DefaultValue="RootWeb"/>
          <ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
          <ParameterBinding Name="ManualRefresh" Location="WPProperty[ManualRefresh]"/>
          <ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
          <ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
          <ParameterBinding Name="dvt_groupfield" Location="Postback;Connection"/>
         </ParameterBindings>
    <DataFields>


    @Title,Title;@EventDate,EventDate;@EndDate,EndDate;@Description,Description;@Location,Location;@fRecurrence,fRecurrence;@WorkspaceLink,WorkspaceLink;@Building_x002f_Room,Building_x002f_Room;@Contact_x0020_Alias,Contact_x0020_Alias;@Format,Format;@Is_x0020_Registration_x0020_Requ,Is_x0020_Registration_x0020_Requ;@Is_x0020_Registration_x0020_Requ.value,Is_x0020_Registration_x0020_Requ.value;@Registration_x0020_URL,Registration_x0020_URL;@Registration_x0020_URL.desc,Registration_x0020_URL.desc;@More_x0020_Info_x0020_URL,More_x0020_Info_x0020_URL;@More_x0020_Info_x0020_URL.desc,More_x0020_Info_x0020_URL.desc;@File_x0020_Type,File_x0020_Type;@HTML_x0020_File_x0020_Type.File_x0020_Type.mapall,HTML_x0020_File_x0020_Type.File_x0020_Type.mapall;@HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon,HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon;@HTML_x0020_File_x0020_Type.File_x0020_Type.mapico,HTML_x0020_File_x0020_Type.File_x0020_Type.mapico;@fAllDayEvent,fAllDayEvent;@fAllDayEvent.value,fAllDayEvent.value;@ParticipantsPicker,ParticipantsPicker;@ParticipantsPicker.id,ParticipantsPicker.id;@ParticipantsPicker.title,ParticipantsPicker.title;@ParticipantsPicker.span,ParticipantsPicker.span;@Category,Category;@FreeBusy,FreeBusy;@Overbook,Overbook;@ID,ID;@ContentType,ContentType;@Modified,Modified;@Created,Created;@Author,Author;@Author.id,Author.id;@Author.title,Author.title;@Author.span,Author.span;@Editor,Editor;@Editor.id,Editor.id;@Editor.title,Editor.title;@Editor.span,Editor.span;@_UIVersionString,_UIVersionString;@Attachments,Attachments;@LinkTitleNoMenu,LinkTitleNoMenu;@LinkTitle,LinkTitle;@FileRef,FileRef;@FileRef.urlencode,FileRef.urlencode;@FileRef.urlencodeasurl,FileRef.urlencodeasurl;@FileDirRef,FileDirRef;@Created_x0020_Date,Created_x0020_Date;@Created_x0020_Date.ifnew,Created_x0020_Date.ifnew;@FSObjType,FSObjType;@SortBehavior,SortBehavior;@PermMask,PermMask;@FileLeafRef,FileLeafRef;@FileLeafRef.Name,FileLeafRef.Name;@FileLeafRef.Suffix,FileLeafRef.Suffix;@SyncClientId,SyncClientId;@DocIcon,DocIcon;@MetaInfo,MetaInfo;@MetaInfo.,MetaInfo.;@ItemChildCount,ItemChildCount;@FolderChildCount,FolderChildCount;</DataFields>
    <Xsl> 

     <xsl:stylesheet version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">
     <xsl:output method="html" indent="no"/>
     <xsl:decimal-format NaN=""/>
          <xsl:param name="dvt_apos">&apos;</xsl:param>
          <xsl:param name="ManualRefresh"></xsl:param>
          <xsl:param name="dvt_groupfield" />
          <xsl:variable name="dvt_1_automode">0</xsl:variable>
          
          <xsl:template match="/" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:SharePoint="Microsoft.SharePoint.WebControls">
           <xsl:choose>
            <xsl:when test="($ManualRefresh = 'True')">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
         <tr>
          <td valign="top">
           <xsl:call-template name="dvt_1"/>
          </td>
          <td width="1%" class="ms-vb" valign="top">
           <img src="/_layouts/images/staticrefresh.gif" id="ManualRefresh" border="0" onclick="javascript: {ddwrt:GenFireServerEvent('__cancel')}" alt="Click here to refresh the dataview."/>
          </td>
          <td>
          <img src=""></img>
          </td>
         </tr>
        </table>
       </xsl:when>
            <xsl:otherwise>
             <xsl:call-template name="dvt_1"/>
       </xsl:otherwise>
           </xsl:choose>
     </xsl:template>
          
          <xsl:template name="dvt_1">
           <xsl:variable name="dvt_StyleName">Table</xsl:variable>
           <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>
           <xsl:variable name="dvt_RowCount" select="count($Rows)"/>
           <xsl:variable name="IsEmpty" select="$dvt_RowCount = 0" />
           <xsl:variable name="dvt_IsEmpty" select="$dvt_RowCount = 0"/>
           
           <xsl:choose>
            <xsl:when test="$dvt_IsEmpty">
             <xsl:call-template name="dvt_1.empty"/>
       </xsl:when>
            <xsl:otherwise>
        <table border="0" width="100%" cellpadding="2" cellspacing="0">
         <!--<tr valign="top">
          <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
           <th class="ms-vh" width="1%" nowrap="nowrap"></th>
          </xsl:if>
          <th class="ms-vh" nowrap="nowrap">Location</th>
          <th class="ms-vh" nowrap="nowrap">Title</th>
          <th class="ms-vh" nowrap="nowrap">Description</th>
         </tr>-->
         <!--<tr>
         <td align="right">
         <a onclick="ShowCalenderDialog('/EventsHome/SiteAssets/ModalCalender.aspx')"><img src="/Reusable/OneLCA-images/fullview-btn.png" ></img></a>
         </td>
         </tr>-->
         <xsl:call-template name="dvt_1.body">
          <xsl:with-param name="Rows" select="$Rows"/>
          <xsl:with-param name="FirstRow" select="1" />
          <xsl:with-param name="LastRow" select="$dvt_RowCount" />
          
         </xsl:call-template>
         
         
     <tr>
            
            <td class="ms-vb" style="clear:left;padding-top:6px;">
          <img src="/Reusable/OneLCA-images/plus.png"></img><a class="normal-link" style="cursor:pointer;text-decoration:none;" onclick="OpenNewFormUrl_PopUp('/Lists/Events/NewForm.aspx')">Add New Event</a>
         
          
         </td>

            </tr>
         
        </table>
       </xsl:otherwise>
           </xsl:choose>
           </xsl:template>
          <xsl:template name="dvt_1.body">
           <xsl:param name="Rows"/>
           <xsl:param name="FirstRow" />
           <xsl:param name="LastRow" />
           <xsl:variable name="dvt_Rows"><root>
            <xsl:for-each select="$Rows">
             <xsl:if test="(position() &gt;= $FirstRow and position() &lt;= $LastRow)"><xsl:copy-of select="." /></xsl:if>
            </xsl:for-each>
            </root></xsl:variable>
           <xsl:for-each select="$Rows">
            <xsl:variable name="NewGroup_0">
             <xsl:choose>
              <xsl:when test="not ($dvt_groupfield)"><xsl:value-of select="ddwrt:NameChanged(string(@EventDate), 0)" /></xsl:when>
              <xsl:otherwise></xsl:otherwise>
             </xsl:choose>
            </xsl:variable>
            <xsl:choose>
             <xsl:when test="0" />
             <xsl:when test="not($dvt_groupfield) and (not($NewGroup_0='') and position() &gt;= $FirstRow and position() &lt;= $LastRow or ($FirstRow = position()))">
              <xsl:variable name="groupheader0">
               <xsl:choose>
                <xsl:when test="not (@EventDate) and (@EventDate) != false()"><xsl:value-of select="' '" /></xsl:when>
                <xsl:otherwise><xsl:value-of select="ddwrt:GenDisplayName(string(@EventDate))" /></xsl:otherwise>
               </xsl:choose>
              </xsl:variable>
              <xsl:if test="not ((position()=1) or (position()=$FirstRow))"></xsl:if>
              <xsl:call-template name="dvt_1.groupheader0">
               <xsl:with-param name="fieldtitle">EventDate</xsl:with-param>
               <xsl:with-param name="fieldname">EventDate</xsl:with-param>
               <xsl:with-param name="fieldvalue" select="$groupheader0" />
               <xsl:with-param name="fieldtype" select="'isodatetime'" />
               <xsl:with-param name="nodeset" select="msxsl:node-set($dvt_Rows)/root//Row[((ddwrt:GenDisplayName(string(@EventDate)))=$groupheader0 or ((not(ddwrt:GenDisplayName(string(@EventDate))) or ddwrt:GenDisplayName(string(@EventDate))='') and $groupheader0=' '))]" />
               <xsl:with-param name="groupid" select="'0'" />
               <xsl:with-param name="displaystyle" select="'auto'" />
               <xsl:with-param name="imagesrc" select="'/_layouts/images/minus.gif'" />
               <xsl:with-param name="alttext" select="'collapse'" />
               <xsl:with-param name="altname" select="'expand'" />
               <xsl:with-param name="hidedetail" select="false()" />
               <xsl:with-param name="showheader" select="true()" />
               <xsl:with-param name="showheadercolumn" select="false()" />
              </xsl:call-template>
             </xsl:when>
            </xsl:choose>
            
            <xsl:variable name="BreakOut">
             <xsl:choose>
              <xsl:when test="not($dvt_groupfield) and position()=$LastRow+1"><xsl:value-of select="ddwrt:NameChanged('', -1)" /></xsl:when>
              <xsl:otherwise>BreakOut</xsl:otherwise>
             </xsl:choose>
            </xsl:variable>
            
            <xsl:variable name="dvt_KeepItemsTogether" select="false()" />
            
            <xsl:variable name="dvt_HideGroupDetail" select="false()" />
            <xsl:if test="(position() &gt;= $FirstRow and position() &lt;= $LastRow) or $dvt_KeepItemsTogether">
             <xsl:if test="not($dvt_HideGroupDetail)" ddwrt:cf_ignore="1">
              <xsl:call-template name="dvt_1.rowview" />
             </xsl:if>
            </xsl:if>
            <xsl:choose>
             <xsl:when test="0" />
            </xsl:choose>
            
           </xsl:for-each>
                 
           
    </xsl:template>
          <xsl:template name="dvt_1.rowview">
          
          <xsl:if test="ddwrt:FormatDateTime(string(@EventDate), 1033, 'yyyyMMdd') &gt;= ddwrt:FormatDateTime(string(ddwrt:Today()), 1033, 'yyyyMMdd')">

          
      <tr>
       <xsl:if test="position() mod 2 = 1">
        <xsl:attribute name="class">ms-alternating</xsl:attribute>
       </xsl:if>
       <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
        <td class="ms-vb" width="1%" nowrap="nowrap">
         <span ddwrt:amkeyfield="" ddwrt:amkeyvalue="''" ddwrt:ammode="view"></span>
        </td>
       </xsl:if>
       <!--<td style="Border-top: 1px solid #c8e4ed;Border-bottom: 1px solid #c8e4ed;Background-color:#f1f1f1; width:300px">
        <table  width="100%">

                <tr>
                  <td style="height: 28px" >
                  <a class="normal-link" onclick="OpenNewFormUrl_PopUp('/Lists/Events/DispForm.aspx?ID={@ID} ')"><xsl:value-of select="@Title"/></a></td>
                </tr>
                <tr>
                  <td class="body-text" style="margin:0px;padding:0px;" >
                <xsl:choose>
            <xsl:when test="string-length(@Description) &gt; 45">
            
            <div>
                   <xsl:value-of select="concat(substring(@Description,1,45),'...')" disable-output-escaping="yes"  />   </div>
                 
            </xsl:when>
           <xsl:otherwise>
             <div>
                   <xsl:value-of select="@Description" disable-output-escaping="yes"  />Hi <xsl:value-of select="@Location" />
                 </div>
                   </xsl:otherwise>
           </xsl:choose>
            
        

    </td>
                  
                </tr>          
               
               
              </table>
       </td>-->
       
       <td style="Border-top: 1px solid #c8e4ed;Border-bottom: 1px solid #c8e4ed;Background-color:#f1f1f1; width:300px">
       
       <table  width="100%">

                <tr>
                  <td style="height: 28px" >
                    <a class="normal-link" style="cursor:pointer;text-decoration:none;" onclick="OpenNewFormUrl_PopUp('/Lists/Events/DispForm.aspx?ID={@ID} ')"><xsl:value-of select="@Title"/></a></td>
                </tr>
                <tr>
                   <td class="event-desc" style="margin:0px;padding:0px;" >
                   <xsl:if test="@Description != ''">
                          <xsl:if test="@Location != ''">
                  
                   <xsl:variable name="pureText">
           <xsl:call-template name="removeHtmlTags">
              <xsl:with-param name="html" select="@Description" />
             </xsl:call-template>
         </xsl:variable>
        
         <xsl:choose>
              <xsl:when test="string-length($pureText) &gt; 30">
             
              <span style="float:left; width: 258px;"><xsl:value-of select="concat(substring($pureText,1,30),'...')" disable-output-escaping="yes" /> , <xsl:value-of select="@Location" /></span>
                  <span style="clear:left;"></span> 
             
              </xsl:when>
             
              <xsl:otherwise>
           
             <span style="float:left; width: 258px;"><xsl:value-of select="$pureText" disable-output-escaping="yes" /> , <xsl:value-of select="@Location" /></span>
                  <span style="clear:left;"></span>
                 
                   </xsl:otherwise>
           </xsl:choose>    

                    </xsl:if>
                   </xsl:if>            
                  
                   <xsl:if test="@Description != ''">
                          <xsl:if test="@Location = ''">
                         
                          <xsl:variable name="pureText">
           <xsl:call-template name="removeHtmlTags">
              <xsl:with-param name="html" select="@Description" />
             </xsl:call-template>
         </xsl:variable>
        
         <xsl:choose>
              <xsl:when test="string-length($pureText) &gt; 30">

        <span style="float:left; width: 258px;"><xsl:value-of select="concat(substring($pureText,1,30),'...')" disable-output-escaping="yes" /></span>
         </xsl:when>
             
              <xsl:otherwise>

                   <span style="float:left; width: 258px;"><xsl:value-of select="$pureText" disable-output-escaping="yes" /></span>
                          
                  </xsl:otherwise>
           </xsl:choose>
                    </xsl:if>
                   </xsl:if>  
        
         <xsl:if test="@Description = ''">
                          <xsl:if test="@Location != ''">
                          <xsl:value-of select="@Location" />
                    </xsl:if>
                   </xsl:if>               
                  
                  
                 </td>
                  
                </tr>
                          
               
              </table>
       
       </td>
       
      </tr>
     </xsl:if>
     </xsl:template>
     
     <xsl:template name="removeHtmlTags">
        <xsl:param name="html"/>
        <xsl:choose>
            <xsl:when test="contains($html, '&lt;')">
                <xsl:value-of select="substring-before($html, '&lt;')"/>
                <!-- Recurse through HTML -->
                <xsl:call-template name="removeHtmlTags">
                    <xsl:with-param name="html" select="substring-after($html, '&gt;')"/>
                </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="$html"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

          <xsl:template name="dvt_1.empty">
           <xsl:variable name="dvt_ViewEmptyText">There are no items to show in this view.</xsl:variable>
      <table border="0" width="100%">
       <tr>
        <td class="ms-vb">
         <xsl:value-of select="$dvt_ViewEmptyText"/>
        </td>
       </tr>
      </table>
     </xsl:template>
          <xsl:template name="dvt_1.groupheader0">
      <xsl:param name="fieldtitle" />
      <xsl:param name="fieldname" />
      <xsl:param name="fieldvalue" />
      <xsl:param name="fieldtype" />
      <xsl:param name="nodeset" />
      <xsl:param name="groupid" />
      <xsl:param name="displaystyle" />
      <xsl:param name="imagesrc" />
      <xsl:param name="alttext" />
      <xsl:param name="altname" />
      <xsl:param name="hidedetail" />
      <xsl:param name="showheader" />
      <xsl:param name="showheadercolumn" />
      <xsl:param name="count" select="1"/>
      <xsl:param name="total" select="1"/>

      
      <xsl:variable name="dateTime" select="ddwrt:FormatDate(string(@EventDate), 1033, 3)" />
      <xsl:variable name="date"  select="substring-before(substring-after($dateTime, ', '), ', ')" />
      <xsl:variable name="month" select="substring-before($date, ' ')" />
      <xsl:variable name="day"   select="substring-after($date, ' ')" />
      <xsl:variable name="date1"  select="ddwrt:FormatDate(string(@EventDate), 1033, 1)" />
      <xsl:variable name="date2"  select="ddwrt:FormatDate(string(@EventDate), 1033, 7)" />
      <xsl:variable name="month1" select="substring-before($date1, '/')" />
      <xsl:variable name="dateyear" select="substring-after($date1, '/')" />
      <xsl:variable name="day1" select="substring-before($dateyear, '/')" />
      <xsl:variable name="dayname" select="substring-before($date2, ',')" />


      <xsl:choose>
         <xsl:when test="$count &lt; 2">
      <xsl:if test="ddwrt:FormatDateTime(string(@EventDate), 1033, 'yyyyMMdd') &gt;= ddwrt:FormatDateTime(string(ddwrt:Today()), 1033, 'yyyyMMdd')">
      
      

       <xsl:if test="$showheader" ddwrt:cf_ignore="1">
       <tr id="group{$groupid}" style="display:{$displaystyle}">
        <td class="ms-gb">
         <xsl:choose>
          <xsl:when test="$groupid='0' or $groupid='9'">
           <xsl:text></xsl:text>
          </xsl:when>
          <xsl:when test="$groupid='1'">
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
          </xsl:when>
          <xsl:when test="$groupid='2'">
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
          </xsl:when>
          <xsl:when test="$groupid='3'">
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
          </xsl:when>
          <xsl:when test="$groupid='4'">
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
          </xsl:when>
          <xsl:when test="$groupid='5'">
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
          </xsl:when>
          <xsl:when test="$groupid='6'">
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
           <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
          </xsl:when>
         </xsl:choose>
         <xsl:if test="not($hidedetail)" ddwrt:cf_ignore="1">
          
         </xsl:if>
         <xsl:choose>
          <xsl:when test="$fieldtype='url'">
           <a href="{$fieldvalue}">
            <xsl:value-of select="$fieldvalue" />
           </a>
          </xsl:when>
          <xsl:when test="$fieldtype='user'">
           <xsl:value-of select="$fieldvalue" disable-output-escaping="yes" />
          </xsl:when>
          <xsl:when test="ddwrt:FormatDateTime(string(ddwrt:Today()), 1033, 'yyyyMMdd') = ddwrt:FormatDateTime(string(@EventDate), 1033, 'yyyyMMdd')">
          
          
          
          <xsl:if test="(position()= 1)">
          <span class="event-date" style="float:left;">Today</span><span style="float:right;" ><a style="cursor:pointer;" onclick="ShowCalenderDialog('/EventsHome/SiteAssets/ModalCalender.aspx')"><img src="/Reusable/OneLCA-images/fullview-btn.png" ></img></a></span><span style="clear:both"></span>
          </xsl:if>
          <xsl:if test="not (position()= 1)">

          <span class="event-date">Today</span>

          
          </xsl:if>
          </xsl:when>

          <xsl:when test="ddwrt:FormatDateTime(string(ddwrt:Today()), 1033, 'yyyyMMdd') &lt;= ddwrt:FormatDateTime(string(@EventDate), 1033, 'yyyyMMdd')">
          <xsl:if test="(position()= 1)">

          
           <span class="event-date" style="float:left;">       
           <xsl:value-of select="$month1" />/<xsl:value-of select="$day1" />
           <xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:whitespace-preserve="yes" xml:space="preserve"> </xsl:text>
           <xsl:value-of select="$dayname" /> </span> 
           <span style="float:right;" ><a style="cursor:pointer;" onclick="ShowCalenderDialog('/EventsHome/SiteAssets/ModalCalender.aspx')"><img src="/Reusable/OneLCA-images/fullview-btn.png" ></img></a> </span>
           <span style="clear:both;"></span>
           </xsl:if> 
                 
          <xsl:if test="not (position()= 1)">

          <span class="event-date">       
           <xsl:value-of select="$month1" />/<xsl:value-of select="$day1" />
           <xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:whitespace-preserve="yes" xml:space="preserve"> </xsl:text>
           <xsl:value-of select="$dayname" /> </span>

          
          
          </xsl:if>
           
    </xsl:when>
          
         </xsl:choose>
         <xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:whitespace-preserve="yes" xml:space="preserve"> </xsl:text>
        </td>
        
       </tr>
      </xsl:if>
      </xsl:if>
      
      <xsl:call-template name="dvt_1.groupheader0">
            <xsl:with-param name="count" select="$count + 1"/>
         
          </xsl:call-template>
        </xsl:when>

        <xsl:otherwise/>
      </xsl:choose>

      
      
     </xsl:template></xsl:stylesheet></Xsl>
    <DataSources>
    <SharePoint:SPDataSource runat="server" DataSourceMode="List" SelectCommand="&lt;View&gt;&lt;Query&gt;&lt;Where&gt;&lt;Geq&gt;&lt;FieldRef Name=&quot;EventDate&quot; Ascending=&quot;TRUE&quot;/&gt;&lt;Value Type=&quot;DateTime&quot;&gt;&lt;Today/&gt;&lt;/Value&gt;&lt;/Geq&gt;&lt;/Where&gt;&lt;OrderBy&gt;&lt;FieldRef Name=&quot;EventDate&quot; Ascending=&quot;TRUE&quot;/&gt;&lt;/OrderBy&gt;&lt;/Query&gt;&lt;/View&gt;" UseInternalName="True" ID="SPDataSource3"><SelectParameters><WebPartPages:DataFormParameter ParameterKey="ListName" PropertyName="ParameterValues" DefaultValue="Events" Name="ListName"></WebPartPages:DataFormParameter><WebPartPages:DataFormParameter ParameterKey="WebID" PropertyName="ParameterValues" DefaultValue="RootWeb" Name="WebID"></WebPartPages:DataFormParameter>
    </SelectParameters>
    </SharePoint:SPDataSource>
    </DataSources>
    </WebPartPages:DataFormWebPart>


    Tuesday, July 5, 2011 5:37 AM