Skip to content
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

2 DataGrid Sync #4813

Closed
PatTheLad opened this issue Jun 9, 2023 · 6 comments
Closed

2 DataGrid Sync #4813

PatTheLad opened this issue Jun 9, 2023 · 6 comments
Labels
Status: Not Planned Type: Feature ⚙ Request or idea for a new feature.

Comments

@PatTheLad
Copy link

Is there any way to sync two datagrids together?

  • Synced scrolling
  • Synced page switch
  • etc.
@PatTheLad PatTheLad added the Type: Feature ⚙ Request or idea for a new feature. label Jun 9, 2023
@stsrki
Copy link
Collaborator

stsrki commented Jun 12, 2023

Synced scrolling

Scrolling is not possible out-of-the-box. You could probably do it with some custom JS.

Synced page switch

This is possible to do. You need to bind the page number to the same variable and propagate it to DataGird with the CurrentPage parameter.

@David-Moreira

@PatTheLad
Copy link
Author

Sounds promising.
Im gonna give it a try as soon as I can.
Thanks for the fast reply!

@David-Moreira
Copy link
Contributor

David-Moreira commented Jun 12, 2023

@PatTheLad @stsrki
Actually we do have scrolling apis on the DataGrid, if you're using Virtualize or FixedHeader feature. You should be able to call it on both grids and also sync it up.

image

as the ScrollToRow expects a row index, you can also use this helper, SelectedRowIndex:
image

Edit:
But to answer your original question, syncing is not supported out of the box, you will always have to make sure that whatever is bound to both grids is the same Parameter or call whatever syncing mechanism you come up with in both grids.

@David-Moreira
Copy link
Contributor

David-Moreira commented Jun 12, 2023

This issue might be interesting to track, #4651
We'd like to come up with some kind of centralized state api. It would make it much easier to check the grid state, load it from some saved state, etc...

@PatTheLad PatTheLad reopened this Jun 13, 2023
@PatTheLad
Copy link
Author

Awesome!
Is there any way you can also sync the filters if you are using the same data for both datagrids?
Or should i just write a custom filter method?

@David-Moreira
Copy link
Contributor

Hello,

I don't think that's an easy one, if you mean to actually display / sync up the bound filter text on both grids and all. You will have to come up with a custom implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Not Planned Type: Feature ⚙ Request or idea for a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants