Blazorise DataGrid: Fixed Header

Fixed Header

#
First Name
Last Name
Email
Salary
1SamuelCollierSamuel.Collier62@gmail.com86 030,41 €
2IrvinZiemannIrvin.Ziemann@gmail.com61 781,31 €
3GeraldPollichGerald82@yahoo.com58 810,75 €
4CoraConnCora27@yahoo.com84 414,66 €
5AlfonsoD'AmoreAlfonso.DAmore@hotmail.com69 318,29 €
6JessieWilkinsonJessie_Wilkinson@gmail.com78 566,12 €
7GregoryRennerGregory63@hotmail.com57 456,82 €
8MaryannHilpertMaryann.Hilpert12@gmail.com89 153,38 €
9MerlePacochaMerle3@gmail.com55 349,94 €
10AngelinaWardAngelina42@gmail.com73 625,86 €
11KaraBrekkeKara.Brekke@hotmail.com58 321,87 €
12YvetteFerryYvette22@gmail.com89 658,90 €
13PabloFriesenPablo_Friesen96@gmail.com77 090,27 €
14ErnestHomenickErnest_Homenick92@yahoo.com54 910,14 €
15LeslieWehnerLeslie_Wehner@hotmail.com78 930,58 €
16MiguelLynchMiguel.Lynch0@gmail.com65 348,06 €
17TommySwaniawskiTommy_Swaniawski@gmail.com92 326,27 €
18ViolaWildermanViola.Wilderman@yahoo.com76 575,00 €
19BrendaJacobsonBrenda_Jacobson55@gmail.com86 145,68 €
20RogerHerzogRoger_Herzog@gmail.com53 168,45 €
21CaseyWeberCasey90@yahoo.com56 257,49 €
22TaraSchoenTara_Schoen@yahoo.com72 637,29 €
23AlSanfordAl_Sanford1@yahoo.com88 870,12 €
24JillStokesJill.Stokes@yahoo.com59 252,89 €
25MarianArmstrongMarian_Armstrong@yahoo.com69 182,74 €
26JanieStantonJanie26@yahoo.com51 608,79 €
27DixieBlockDixie65@yahoo.com89 653,26 €
28TeresaDietrichTeresa.Dietrich@yahoo.com56 151,34 €
29ReneeHerzogRenee39@yahoo.com93 592,47 €
30DamonLubowitzDamon_Lubowitz@hotmail.com89 271,37 €
31CodyRauCody56@hotmail.com63 067,69 €
32EthelKassulkeEthel.Kassulke@yahoo.com92 175,30 €
33RudyWalshRudy_Walsh54@gmail.com76 356,17 €
34RossHauckRoss18@hotmail.com51 620,31 €
35OtisLittleOtis_Little28@hotmail.com77 906,94 €
36BenjaminFriesenBenjamin40@yahoo.com78 343,54 €
37MosesMosciskiMoses_Mosciski@gmail.com99 202,48 €
38KellieMurazikKellie_Murazik@gmail.com98 314,89 €
39NicholeKeeblerNichole69@gmail.com65 412,00 €
40BobbieRogahnBobbie.Rogahn7@yahoo.com52 889,16 €
41CharlieBorerCharlie.Borer68@hotmail.com50 448,59 €
42LuisRutherfordLuis.Rutherford@hotmail.com83 594,06 €
43JaredPfannerstillJared82@gmail.com54 282,76 €
44FloydSatterfieldFloyd96@yahoo.com59 157,17 €
45ClaudeParkerClaude_Parker55@gmail.com58 576,97 €
46DonaldDaughertyDonald.Daugherty@gmail.com66 692,86 €
47RolandBruenRoland5@yahoo.com98 404,23 €
48PaulineConroyPauline_Conroy@yahoo.com69 674,96 €
49LoraLockmanLora55@hotmail.com74 035,99 €
50JoeyKoelpinJoey_Koelpin@yahoo.com57 184,86 €
51StaceyGrahamStacey_Graham88@gmail.com88 562,39 €
52DaisyMedhurstDaisy75@yahoo.com51 011,13 €
53ErinCorwinErin_Corwin17@gmail.com70 013,81 €
54ArturoDenesikArturo.Denesik@gmail.com61 456,56 €
55CherylCollierCheryl.Collier@yahoo.com59 868,88 €
56AndresWilliamsonAndres34@yahoo.com74 180,71 €
57PhyllisWildermanPhyllis.Wilderman90@gmail.com59 518,29 €
58BillyWizaBilly84@gmail.com92 241,90 €
59WoodrowGibsonWoodrow_Gibson55@yahoo.com90 288,10 €
60CristinaHarrisCristina.Harris@yahoo.com81 762,53 €
61DarleneDanielDarlene.Daniel52@gmail.com74 142,55 €
62CourtneyFramiCourtney.Frami@yahoo.com68 435,70 €
63MaeFeeneyMae92@gmail.com65 623,26 €
64JoshDoyleJosh75@yahoo.com87 057,60 €
65GwenAbbottGwen.Abbott86@yahoo.com65 189,89 €
66MonaBeierMona8@gmail.com80 367,71 €
67MinnieCorwinMinnie_Corwin96@yahoo.com78 002,56 €
68DwightRunolfssonDwight99@gmail.com73 986,40 €
69BethBartellBeth.Bartell@yahoo.com85 841,65 €
70SteveSchulistSteve_Schulist@hotmail.com94 190,45 €
71PamGreenholtPam44@gmail.com75 695,28 €
72DarrelWilliamsonDarrel_Williamson@yahoo.com70 327,72 €
73RolandoSauerRolando_Sauer@hotmail.com84 971,22 €
74CesarSchaeferCesar79@yahoo.com92 704,04 €
75LuisLeannonLuis13@gmail.com61 167,01 €
76FannieWilliamsonFannie_Williamson@gmail.com94 194,50 €
77MariannePourosMarianne_Pouros60@hotmail.com71 394,54 €
78SpencerRogahnSpencer.Rogahn12@gmail.com55 993,84 €
79DonnieLuettgenDonnie_Luettgen@hotmail.com77 655,38 €
80BlancaBreitenbergBlanca77@hotmail.com75 633,97 €
81PatRohanPat_Rohan@gmail.com50 151,72 €
82VirginiaKassulkeVirginia_Kassulke@yahoo.com77 411,81 €
83LelaBreitenbergLela_Breitenberg44@hotmail.com53 894,64 €
84RandalKossRandal.Koss67@hotmail.com93 602,37 €
85KimberlyChristiansenKimberly_Christiansen2@hotmail.com65 089,52 €
86JeanBoyerJean42@hotmail.com99 805,01 €
87MurielShieldsMuriel.Shields12@gmail.com66 809,95 €
88MarcusEmmerichMarcus_Emmerich@yahoo.com99 401,27 €
89FaithNicolasFaith.Nicolas@yahoo.com50 439,25 €
90BoydDavisBoyd_Davis@gmail.com58 591,48 €
91WilburStiedemannWilbur29@gmail.com64 479,16 €
92RobertoStrackeRoberto_Stracke@yahoo.com57 007,18 €
93MindySmithamMindy.Smitham5@hotmail.com56 810,55 €
94DianneMaggioDianne.Maggio83@yahoo.com73 990,94 €
95MandyBahringerMandy55@hotmail.com69 018,94 €
96MarlonLednerMarlon.Ledner26@hotmail.com72 372,09 €
97LaverneSchusterLaverne.Schuster38@gmail.com84 767,07 €
98KendraCorkeryKendra_Corkery@gmail.com79 303,18 €
99ChrisBartonChris.Barton@yahoo.com68 642,57 €
100EdPriceEd.Price21@gmail.com84 665,20 €
<DataGrid TItem="Employee"
          Data="@employeeList"
          @bind-SelectedRow="@selectedEmployee"
          Responsive
          PageSize="100"
          FixedHeader
          FixedHeaderDataGridMaxHeight="300px">
    <DataGridCommandColumn />
    <DataGridColumn Field="@nameof(Employee.Id)" Caption="#" Sortable="false" />
    <DataGridColumn Field="@nameof(Employee.FirstName)" Caption="First Name" Editable />
    <DataGridColumn Field="@nameof(Employee.LastName)" Caption="Last Name" Editable />
    <DataGridColumn Field="@nameof(Employee.Email)" Caption="Email" Editable />
    <DataGridColumn Field="@nameof(Employee.Salary)" Caption="Salary" DisplayFormat="{0:C}" DisplayFormatProvider="@System.Globalization.CultureInfo.GetCultureInfo("fr-FR")" Editable>
        <EditTemplate>
            <NumericEdit TValue="decimal" Value="@((decimal)context.CellValue)" ValueChanged="@( v => context.CellValue = v)" />
        </EditTemplate>
    </DataGridColumn>
</DataGrid>
@code {
    [Inject]
    public EmployeeData EmployeeData { get; set; }
    private List<Employee> employeeList;
    private Employee selectedEmployee;

    protected override async Task OnInitializedAsync()
    {
        employeeList = await EmployeeData.GetDataAsync();
        await base.OnInitializedAsync();
    }
}

Scroll To

Scroll to API is available when the DataGrid FixedHeader or Virtualize is set.
#
First Name
Last Name
Email
Salary
1SamuelCollierSamuel.Collier62@gmail.com86 030,41 €
2IrvinZiemannIrvin.Ziemann@gmail.com61 781,31 €
3GeraldPollichGerald82@yahoo.com58 810,75 €
4CoraConnCora27@yahoo.com84 414,66 €
5AlfonsoD'AmoreAlfonso.DAmore@hotmail.com69 318,29 €
6JessieWilkinsonJessie_Wilkinson@gmail.com78 566,12 €
7GregoryRennerGregory63@hotmail.com57 456,82 €
8MaryannHilpertMaryann.Hilpert12@gmail.com89 153,38 €
9MerlePacochaMerle3@gmail.com55 349,94 €
10AngelinaWardAngelina42@gmail.com73 625,86 €
11KaraBrekkeKara.Brekke@hotmail.com58 321,87 €
12YvetteFerryYvette22@gmail.com89 658,90 €
13PabloFriesenPablo_Friesen96@gmail.com77 090,27 €
14ErnestHomenickErnest_Homenick92@yahoo.com54 910,14 €
15LeslieWehnerLeslie_Wehner@hotmail.com78 930,58 €
16MiguelLynchMiguel.Lynch0@gmail.com65 348,06 €
17TommySwaniawskiTommy_Swaniawski@gmail.com92 326,27 €
18ViolaWildermanViola.Wilderman@yahoo.com76 575,00 €
19BrendaJacobsonBrenda_Jacobson55@gmail.com86 145,68 €
20RogerHerzogRoger_Herzog@gmail.com53 168,45 €
21CaseyWeberCasey90@yahoo.com56 257,49 €
22TaraSchoenTara_Schoen@yahoo.com72 637,29 €
23AlSanfordAl_Sanford1@yahoo.com88 870,12 €
24JillStokesJill.Stokes@yahoo.com59 252,89 €
25MarianArmstrongMarian_Armstrong@yahoo.com69 182,74 €
26JanieStantonJanie26@yahoo.com51 608,79 €
27DixieBlockDixie65@yahoo.com89 653,26 €
28TeresaDietrichTeresa.Dietrich@yahoo.com56 151,34 €
29ReneeHerzogRenee39@yahoo.com93 592,47 €
30DamonLubowitzDamon_Lubowitz@hotmail.com89 271,37 €
31CodyRauCody56@hotmail.com63 067,69 €
32EthelKassulkeEthel.Kassulke@yahoo.com92 175,30 €
33RudyWalshRudy_Walsh54@gmail.com76 356,17 €
34RossHauckRoss18@hotmail.com51 620,31 €
35OtisLittleOtis_Little28@hotmail.com77 906,94 €
36BenjaminFriesenBenjamin40@yahoo.com78 343,54 €
37MosesMosciskiMoses_Mosciski@gmail.com99 202,48 €
38KellieMurazikKellie_Murazik@gmail.com98 314,89 €
39NicholeKeeblerNichole69@gmail.com65 412,00 €
40BobbieRogahnBobbie.Rogahn7@yahoo.com52 889,16 €
41CharlieBorerCharlie.Borer68@hotmail.com50 448,59 €
42LuisRutherfordLuis.Rutherford@hotmail.com83 594,06 €
43JaredPfannerstillJared82@gmail.com54 282,76 €
44FloydSatterfieldFloyd96@yahoo.com59 157,17 €
45ClaudeParkerClaude_Parker55@gmail.com58 576,97 €
46DonaldDaughertyDonald.Daugherty@gmail.com66 692,86 €
47RolandBruenRoland5@yahoo.com98 404,23 €
48PaulineConroyPauline_Conroy@yahoo.com69 674,96 €
49LoraLockmanLora55@hotmail.com74 035,99 €
50JoeyKoelpinJoey_Koelpin@yahoo.com57 184,86 €
1 - 50 of 499 items
499 items
<Button Size="Size.Small" Color="Color.Primary" Clicked="@ScrollToRow">Scroll To Row</Button>
<Button Size="Size.Small" Color="Color.Primary" Clicked="@ScrollToPixels">Scroll To Pixels</Button>

<DataGrid @ref="dataGridRef"
          TItem="Employee"
          Data="@employeeList"
          @bind-SelectedRow="@selectedEmployee"
          Responsive
          ShowPager
          FixedHeader
          FixedHeaderDataGridMaxHeight="250px"
          PageSize="50">
    <DataGridCommandColumn />
    <DataGridColumn Field="@nameof(Employee.Id)" Caption="#" Sortable="false" />
    <DataGridColumn Field="@nameof(Employee.FirstName)" Caption="First Name" Editable />
    <DataGridColumn Field="@nameof(Employee.LastName)" Caption="Last Name" Editable />
    <DataGridColumn Field="@nameof(Employee.Email)" Caption="Email" Editable />
    <DataGridColumn Field="@nameof(Employee.Salary)" Caption="Salary" DisplayFormat="{0:C}" DisplayFormatProvider="@System.Globalization.CultureInfo.GetCultureInfo("fr-FR")" Editable>
        <EditTemplate>
            <NumericEdit TValue="decimal" Value="@((decimal)context.CellValue)" ValueChanged="@( v => context.CellValue = v)" />
        </EditTemplate>
    </DataGridColumn>
</DataGrid>
@code {
    [Inject]
    public EmployeeData EmployeeData { get; set; }
    private List<Employee> employeeList;
    private Employee selectedEmployee;
    private DataGrid<Employee> dataGridRef;

    protected override async Task OnInitializedAsync()
    {
        employeeList = await EmployeeData.GetDataAsync();
        await base.OnInitializedAsync();
    }

    private Task ScrollToRow()
         => dataGridRef.ScrollToRow(30).AsTask();

    private Task ScrollToPixels()
        => dataGridRef.ScrollToPixels(500).AsTask();
}

API

See the documentation below for a complete reference to all of the props and classes available to the components mentioned here.

On this page