@using Microsoft.AspNetCore.Http
@using Microsoft.Extensions.DependencyInjection
@using Syncfusion.Blazor.Buttons
@using Syncfusion.Blazor.Calendars
@using Syncfusion.Blazor.Grids
@using Syncfusion.Blazor.Inputs
@using Syncfusion.Blazor.Navigations
@using Syncfusion.Blazor.Popups
@using ClickEventArgs = Syncfusion.Blazor.Navigations.ClickEventArgs
@using InputType = Syncfusion.Blazor.Inputs.InputType
@using SelectionType = Syncfusion.Blazor.Grids.SelectionType
@using FilterType = Syncfusion.Blazor.Grids.FilterType
<div id="ControlRegion">
<SfGrid ID="Grid" DataSource="@_allProjects" @ref="_grid" AllowPaging="true" AllowFiltering="true" AllowReordering="false"
AllowResizing="true" AllowGrouping="false" AllowExcelExport="true" AllowSelection="true" AllowSorting="true" Toolbar="@_gridToolbarItems">
<GridEditSettings AllowAdding="false" AllowEditing="false" AllowDeleting="false"></GridEditSettings>
<GridFilterSettings Type="FilterType.Excel" EnableCaseSensitivity="false">
<GridFilterColumns>
<GridFilterColumn Field=@nameof(DesignProjectViewModel.DesignManager01) MatchCase=false Operator="Operator.StartsWith" Predicate="and" Value="@_currentUser"></GridFilterColumn>
</GridFilterColumns>
</GridFilterSettings>
<GridSelectionSettings Type="SelectionType.Multiple"></GridSelectionSettings>
<GridEvents OnToolbarClick="GridToolbarClick" DataBound="GridDataboundHandler" TValue="DesignProjectViewModel"></GridEvents>
<GridPageSettings PageCount="5" PageSizes="false" PageSize="19"></GridPageSettings>
<GridTemplates>
<DetailTemplate>
</DetailTemplate>
</GridTemplates>
<GridColumns>
<GridColumn Width="100" AllowFiltering="false" Field=@nameof(DesignProjectViewModel.InvestmentKey) HeaderText="Id" IsPrimaryKey="true"></GridColumn>
<GridColumn Width="050" AllowFiltering="true" Field=@nameof(DesignProjectViewModel.IsNonRadarProject) HeaderText="NRP" Filter="@(new {type = "CheckBox"})" HeaderTextAlign="TextAlign.Center" TextAlign="TextAlign.Center">
<Template>
@{
var currentRadarProject = (context as DesignProjectViewModel);
var customIsNonRadarProject = (currentRadarProject?.IsNonRadarProject) ?? false;
if (customIsNonRadarProject)
{
<span>Y</span>
}
else
{
<span>N</span>
}
}
</Template>
</GridColumn>
<GridColumn Width="090" AllowFiltering="true" Field=@nameof(DesignProjectViewModel.ProjectNumber) HeaderText="Project #"></GridColumn>
<GridColumn Width="450" AllowFiltering="true" Field=@nameof(DesignProjectViewModel.ProjectName) HeaderText="Name"></GridColumn>
<GridColumn Width="250" AllowFiltering="true" Field=@nameof(DesignProjectViewModel.ProgrammeSponsor) HeaderText="Sponsor"></GridColumn>
<GridColumn Width="250" AllowFiltering="true" Field=@nameof(DesignProjectViewModel.ProgrammeLead) HeaderText="Lead"></GridColumn>
<GridColumn Width="250" AllowFiltering="true" Field=@nameof(DesignProjectViewModel.ProjectManager) HeaderText="Project Manager"></GridColumn>
<GridColumn Width="250" AllowFiltering="true" Field=@nameof(DesignProjectViewModel.DesignManager01) HeaderText="Design Manager"></GridColumn>
<GridColumn Width="200" AllowFiltering="true" Field=@nameof(DesignProjectViewModel.Status) HeaderText="Status"></GridColumn>
<GridColumn Width="070" AllowFiltering="true" Field=@nameof(DesignProjectViewModel.Funding) HeaderText="F"></GridColumn>
<GridColumn Width="100" AllowFiltering="true" Field=@nameof(DesignProjectViewModel.Gate) HeaderText="Gate"></GridColumn>
<GridColumn Width="250" AllowFiltering="true" Field=@nameof(DesignProjectViewModel.DaDeliveryStage) HeaderText="Delivery Stage (DA)"></GridColumn>
<GridColumn Width="120" AllowFiltering="true" Field=@nameof(DesignProjectViewModel.ProjectGate) HeaderText="Project Gate"></GridColumn>
<GridColumn Width="150" AllowFiltering="true" Field=@nameof(DesignProjectViewModel.DesignTeamClassification) HeaderText="Classification"></GridColumn>
</GridColumns>
</SfGrid>
</div>
<style type="text/css" class="cssStyles">
.detailTable td {
font-size: 13px;
padding: 4px;
max-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.formLabelHeader {
font-weight: bold;
}
.tableCellAlignRight {
text-align: right;
}
</style>