Share via


View the Training Dashboard Use Case

When employees log on to the Training Management application, they can see the training dashboard by clicking My Training in the Quick Launch. The dashboard displays the list of available training courses and the list of courses that the current employee has registered for. The following illustration shows an example of the training dashboard.

Training dashboard

Ff649911.0e2c23b4-565f-41c3-8ece-281951216eef(en-us,PandP.10).png

Training Courses and My Registrations Web Parts

The Training Courses Web Part and the My Registrations Web Part are SharePoint List View Web Parts. The Training Courses Web Part is a default list view. The My Registrations Web Part is based on a custom view of the registrations list. Because the data for these two Web Parts is in SharePoint, the standard List View Web Part, combined with a custom view for the My Registrations Web Part, is an ideal way to display it. There is no need to develop a custom user interface.

The My Registrations Web Part is based on the following code that defines the custom registrations list view. The code is located in the ListDefinitions\RegistrationListDefinition\schema.xml file in the Contoso.TrainingManagement project.

...        
<ViewFields>
    <FieldRef Name="LinkTitle">
    </FieldRef>
    <FieldRef Name="RegistrationStatus">
    </FieldRef>
</ViewFields>             
<Query>
    <Where>
        <Eq>
            <FieldRef Name="User" />
            <Value Type="Integer">                            
                <UserID />
            </Value>
        </Eq>
    </Where>
    <OrderBy>
        <FieldRef Name="RegistrationStatus" />
    </OrderBy>
</Query>
...

The List View definition creates an instance of a List View Web Part on the Default.aspx page that displays the custom registrations list view. The code for the definition is located in the Forms\TrainingDashboard\TrainingDashboardElement.xml file of the Contoso.TrainingManagement project.

<View List="Lists/Registrations" BaseViewID="2" RecurrenceRowset="TRUE"
      WebPartZoneID="Left" WebPartOrder="4">
    <![CDATA[
         <WebPart xmlns=https://schemas.microsoft.com/WebPart/v2
                        xmlns:iwp="https://schemas.microsoft.com/WebPart/v2/Image">
             <Assembly>Microsoft.SharePoint, Version=12.0.0.0,
                      Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
             <TypeName>Microsoft.SharePoint.WebPartPages.ListViewWebPart</TypeName>
             <Title>My Registrations</Title>
         </WebPart>
     ]]>
</View>

Home page on MSDN | Community site