Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 154 additions & 0 deletions samples/grids/grid/column-pinning-both-sides/App.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
@using IgniteUI.Blazor.Controls

<div class="container vertical ig-typography">
<div class="container vertical fill">
<IgbGrid
AutoGenerate="false"
Data="CustomersDataLocal"
width="100%"
height="480px"
ColumnSelection="GridSelectionMode.Multiple"
Moving="true"
Pinning="PinningConfig"
Name="grid"
@ref="grid">
<IgbGridToolbar
>

<IgbGridToolbarActions
>
<IgbButton class="pinning-button" Variant="ButtonVariant.Contained" @onclick="() => UnpinColumn()">Unpin Column</IgbButton>
<IgbButton class="pinning-button" Variant="ButtonVariant.Contained" @onclick="() => PinLeft()">Pin Left</IgbButton>
<IgbButton class="pinning-button" Variant="ButtonVariant.Contained" @onclick="() => PinRight()">Pin Right</IgbButton>

</IgbGridToolbarActions>

</IgbGridToolbar>

<IgbColumn
Field="Company"
Header="Company Name"
Width="300px"
/>
<IgbColumn
Field="ContactName"
Header="Contact Name"
Width="200px"
Pinned="true"
PinningPosition="ColumnPinningPosition.Start"
/>
<IgbColumn
Field="ContactTitle"
Header="Contact Title"
Width="200px"
Pinned="true"
PinningPosition="ColumnPinningPosition.End"
/>
<IgbColumn
Field="Address"
Header="Address"
Width="300px">
</IgbColumn>
<IgbColumn
Field="City"
Header="City"
Width="120px"
/>
<IgbColumn
Field="Region"
Header="Region"
Width="120px"
/>
<IgbColumn
Field="PostalCode"
Header="Postal Code"
Width="150px"
/>
<IgbColumn
Field="Phone"
Header="Phone"
Width="150px"
/>
<IgbColumn
Field="Fax"
Header="Fax"
Width="150px"
/>
</IgbGrid>

</div>
</div>

@code {

protected override async Task OnAfterRenderAsync(bool firstRender)
{
var grid = this.grid;
}

private IgbGrid grid;

private CustomersDataLocal _customersDataLocal = null;
public CustomersDataLocal CustomersDataLocal
{
get
{
if (_customersDataLocal == null)
{
_customersDataLocal = new CustomersDataLocal();
}
return _customersDataLocal;
}
}

private IgbPinningConfig _pinningConfig = null;
private IgbPinningConfig PinningConfig
{
get
{
if (this._pinningConfig == null)
{
var pinningConfig1 = new IgbPinningConfig();
pinningConfig1.Columns = ColumnPinningPosition.End;
this._pinningConfig = pinningConfig1;
}
return this._pinningConfig;
}
}

private void PinLeft()
{
var selected = this.grid.SelectedColumns();
if (selected == null) return;

foreach (var col in selected)
{
col.PinningPosition = ColumnPinningPosition.Start;
col.Pinned = true;
}
}

private void PinRight()
{

var selected = this.grid.SelectedColumns();
if (selected == null) return;

foreach (var col in selected)
{
col.PinningPosition = ColumnPinningPosition.End;
col.Pinned = true;
}
}
private void UnpinColumn()
{

var selected = this.grid.SelectedColumns();
if (selected == null) return;

foreach (var col in selected)
{
col.Pinned = false;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<RazorLangVersion>3.0</RazorLangVersion>
<AssemblyName>Infragistics.Samples</AssemblyName>
<RootNamespace>Infragistics.Samples</RootNamespace>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702,IDE0028,BL0005,0219,CS1998</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="IgniteUI.Blazor" Version="25.1.19" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.0" />
<PackageReference Include="System.Net.Http.Json" Version="9.0.0" />
</ItemGroup>

</Project>
25 changes: 25 additions & 0 deletions samples/grids/grid/column-pinning-both-sides/BlazorClientApp.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29613.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorClientApp", "BlazorClientApp.csproj", "{F69CC3F0-BCD1-4CE6-9F39-CBED14E7FA78}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F69CC3F0-BCD1-4CE6-9F39-CBED14E7FA78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F69CC3F0-BCD1-4CE6-9F39-CBED14E7FA78}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F69CC3F0-BCD1-4CE6-9F39-CBED14E7FA78}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F69CC3F0-BCD1-4CE6-9F39-CBED14E7FA78}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FC52AAC8-4488-40AE-9621-75F6BA744B18}
EndGlobalSection
EndGlobal
Loading