-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
QuickGrid: Add EventCallback<TGridItem> for clicking on a row. #44899
Comments
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
I would also suggest to add |
Hello, are you open to input from the community on this? |
@codingrecluse I've taken a look at your fork. I really like your modifications! I'm primarily interested in defining a listener for an entire row which I think you've implemented. Would you be able to help me forking your fancygrid package and creating my own QuickGrid nuget package? I'd like to build my own so I can control the .NET version dependency. |
Any updates on this issue, an onclick event on a row will be really useful for our use-case also. |
I believe that an onclick row feature should be considered as a standard feature like other current QuickGrid features and shouldn't be moved further in the backlog. If the suggested implementation is ok, please release it in the next .NET 8 patch or ask for further elaboration so we can help with this feature. |
@codingrecluse I am interested in knowing how you are approching the row select. Is it possible to provide access to your fork? Thanks. |
This is so annoying! wow. Ended up rolling my own table component in blazor, this quickgrid package is a disgrace. |
Any update on this? |
Any update? |
Any update? |
Any updates? |
Any update? |
Also, any update? will be very nice to have a way to tell row is clicked. |
bump...? |
This is a really HALF baked solution that is super lacking once you actually start using it for anything more than the most BASIC use cases.. I have rolled my own grid view that I use and when I need even more functionality I use Blazor Bootstrap they have AWESOME grids. |
Please could this be considered again as it's been over 2 years and it would be very handy to be able to click on a row such as for selecting a row to edit or delete |
I worked on a workaround today to do this with as little modification as possible and this is what I came up with in case anyone else finds it useful and it is a combination of other approaches where it selects the selected object on click and also highlights the row. I made each column sortable and searchable and was able to retain this: Change a column definition from: <PropertyColumn Property="@(p => p.Name)" Sortable="true">
<ColumnOptions>
<div class="search-box">
<input type="search" class="form-control" autofocus @bind="FilterMainName" @bind:event="oninput" placeholder="Name..." @onkeyup="FilterMainRefresh" @onchange="FilterMainRefresh" />
</div>
</ColumnOptions>
</PropertyColumn> To the following which adds a clickable div which also toggles the <TemplateColumn Title="Name" Sortable="true" SortBy="GridSort<MessageTemplateModel>.ByDescending(x => x.Name)">
<ChildContent>
<div @onclick="()=>SelectMessageTemplate(context.MessageTemplateID)" class="@(context.MessageTemplateID == selectedMessageTemplate?.MessageTemplateID ? "SelectedRow" : "")">
<div class="col-justify-start">@context.Name</div>
</div>
</ChildContent>
<ColumnOptions>
<div class="search-box">
<input type="search" class="form-control" autofocus @bind="FilterMainName" @bind:event="oninput" placeholder="Name..." @onkeyup="FilterMainRefresh" @onchange="FilterMainRefresh" />
</div>
</ColumnOptions>
</TemplateColumn> These are the functions that are called when clicking which load the selected object into a model instance: [SupplyParameterFromForm]
public MessageTemplateModel? selectedMessageTemplate { get; set; } = new MessageTemplateModel();
private MessageTemplateModel? GetMessageTemplate(int messageTemplateID)
{
return messageTemplates?.Where(t => t.MessageTemplateID == messageTemplateID).FirstOrDefault();
}
private void SelectMessageTemplate(int? messageTemplateID)
{
if (messageTemplateID != null && messageTemplateID > 0)
{
selectedMessageTemplate = GetMessageTemplate(messageTemplateID ?? 0);
}
else
{
selectedMessageTemplate = new MessageTemplateModel();
}
} |
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
I'd like to handle the event where a user clicks on a row in a QuickGrid. When this happens I'd use NavigationManager.NavigateTo() to go to the selected item's page.
Describe the solution you'd like
In QuickGrid.razor.cs: add a property '[Parameter] public EventCallback'.
In QuickGrid.razor RenderRow(RenderTreeBuilder, int, TGridItem): add @OnClick to the that invokes the above EventCallback.
Additional context
No response
The text was updated successfully, but these errors were encountered: