-
Notifications
You must be signed in to change notification settings - Fork 10
feat(grids): add column pinning both sides samples #1059
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
IMinchev64
wants to merge
4
commits into
vnext
Choose a base branch
from
iminchev/column-pinning-both-sides
base: vnext
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
1384e67
feat(grids): add column pinning both sides samples
IMinchev64 6609ddb
chore(column-pinning): fix typos in ReadMe
IMinchev64 07a4598
refactor(grids): remove unused OnAfterRenderAsync method from column-…
IMinchev64 9d78bba
refactor(grids): change access modifier in column-pinning-both-side s…
IMinchev64 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } | ||
| } | ||
| } | ||
21 changes: 21 additions & 0 deletions
21
samples/grids/grid/column-pinning-both-sides/BlazorClientApp.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
25
samples/grids/grid/column-pinning-both-sides/BlazorClientApp.sln
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.