This is a migrated thread and some comments may be shown as answers.

Grid Selection demo is missing bind attribute

3 Answers 67 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 17 Oct 2019, 01:30 PM

The Grid Selection demo code is missing the @bind-SelectedItems attribute.  The demo is on this page: https://demos.telerik.com/blazor-ui/grid/selection.  The TelerikGrid element should contain the attribute:

@bind-SelectedItems="SelectedItems"

3 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 17 Oct 2019, 02:45 PM

Hi Ryan,

Thank you for noticing. If we do this binding on the demo, we will have to cater for handling those selected items when the selection mode gets changed, and that's not very likely to happen in a real app. Nevertheless, we will consider the idea. In the meantime, you can find examples of binding the collection and using the event in the documentation:

 

 

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor
0
Ryan
Top achievements
Rank 1
answered on 17 Oct 2019, 04:12 PM

Hi Marin, the demo code was a bit confusing because it declares and sets the SelectedItems variable but it does not get used.  Instead of binding the variable, you could remove these lines:

public IEnumerable<Product> SelectedItems { get; set; }
SelectedItems = GridData.Where(item => item.ProductId > 3 && item.ProductId < 6).ToList();

0
Marin Bratanov
Telerik team
answered on 17 Oct 2019, 04:18 PM

I agree with you completely, and at this point I think we will just use the two-way binding on the demo and combine the current two demos into one. That will happen for our next release, though. I am attaching the WIP version (it has not passed QA yet, and changing the selection mode at runtime is not a scenario we envision to be common).

In the meantime, the documentation provides 6-7 other examples for selection.

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor
Tags
Grid
Asked by
Ryan
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Ryan
Top achievements
Rank 1
Share this question
or