Mewriick / Blazor.FlexGrid

GridView component for Blazor
MIT License
199 stars 35 forks source link

Reload Grid #73

Closed justborg closed 4 years ago

justborg commented 4 years ago

Is there a way to rebind the grid? or change the data adapter at runtime?

Mewriick commented 4 years ago

Hello, No there is not such option to rebind grid at runtime.

justborg commented 4 years ago

Hi, Thanks for your quick reply.

One more question, is it possible to filter the result programmatically when using the standard adapter (not lazy loading) i.e. dataAdapter.Filter?

Thanks in advance :)

Mewriick commented 4 years ago

Only one possible solution is:

       var dataAdapter = new CollectionTableDataAdapter<WeatherForecast>);
        dataAdapter.Filter = w => w ...

This will be only working for first setup of grid.

mswietlicki commented 4 years ago

@justborg Regarding your first question. You can always hack rebinding by destroying the grid and rebuilding it.

@if (dataAdapter != null) { <GridView ... ? /> }

...

dataAdapter = null;
StateHasChanged();
dataAdapter = new CollectionTableDataAdapter<...
Mewriick commented 4 years ago

@justborg

Version 0.11.0 contains new feature which you can use for rebind the data adapter for grid. See the wiki