Hi Ivan,
Thanks for the patience.
Query: “When trying to get the selected rows the list is empty”
We have validated the reported issue at our end by preparing a sample using your code example and we are able to reproduce the reported issue. We have considered the reported query as a bug and it will be included in our next patch release which is expected to be roll out on or before 23rd July 2019.
You can track the status of the issue using the below feedback
Till then we appreciate your patience.
As a workaround you can get the DOM elements using RowSelectedEvents. It will be triggered for each row selection.
Refer the below code example
|
<EjsGrid @ref=defaultGrid DataSource=@gridData RowSelected="rowselect" AllowSelection="true">
……………………………………….
</EjsGrid>
public List<DOM> Temp { get; set; }
public List<Orders> order = new List<Orders>();
public void rowselect(RowSelectEventArgs args)
{
this.Temp.Add(args.Row);
} |
Note: GetSelectedRows() method will return the row elements (i.e) DOM elements in form of array collection. If you want to get the selected record details, we suggest you to achieve your requirement using GetSelectedRecords().
Refer the below screenshot for your reference
|
public void GetRows()
{
var temp = this.defaultGrid.GetSelectedRecords(); // return the details of selceted record
temp.GetAwaiter().OnCompleted(() =>
{
this.Temp = temp.Result; // here you can get the selected row datas in form list of objects.
this.Invoke(this.StateHasChanged);
});
} |
Please get back to us if you have further queries.
Regards,
Vignesh Natarajan.