Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor Quickgrid - how to add a row counter when using Virtualise

$
0
0

Using Blazors Quickgrid. I would like to show a row number for the items.They are 'ApplicationUser' Items. (The id is a guid)It looks like this:

<div class="grid" tabindex="-1"><QuickGrid Items="FilteredUsers" Virtualize="true" @ref="_gridview"><PropertyColumn Property="@(u => u.FirstName)" Sortable="true" /><PropertyColumn Property="@(u => u.LastName)" Sortable="true" Title="Name"><ColumnOptions><input type="search" autofocus @bind="LastNamefilter" @bind:event="oninput" placeholder="Last Name ..." /></ColumnOptions></PropertyColumn>                    .                    .                    .                    more stuff..

The 'FilteredUsers' comes from:

        private IQueryable<ApplicationUser> FilteredUsers;        private void UpdateUsers()        {            FilteredUsers = _rgContext.Users.Where(u => u.LastName!.Contains(LastNamefilter)&& u.Email!.Contains(Emailfilter)&& u.PhoneNumber!.Contains(Phonefilter)             );            totalcount = FilteredUsers.Count();        }

The _rgcontext is created using a contextFactory created in the OnInit function:

        protected override async Task  OnInitializedAsync()        {            _rgContext = _contextFactory.CreateDbContext();            await _userService.CheckUpdateCurrentUserInfo();            UpdateUsers();            await base.OnInitializedAsync();            return;        }

... and disposed: (THough not sure if this is relevant... seems to work so far.

        public void Dispose()        {            _rgContext?.Dispose();        }

I have the totalcount value from the query. But I would like to add a row number.I can't seem to find anywhere I can (say) get a callback to create a column with such a number in it..Any thoughts?


Viewing all articles
Browse latest Browse all 4839

Trending Articles