Georgi Anastasov
answered on Oct 7, 2022 12:48 PM
Verified
Hello Klaus,
I have been looking into your question, however, I'm not sure I understood your requirement and exact scenario completely. In case you require to scroll to a certain row selected or precisely defined during the execution of an event, for example, on a click or on loading the page, this could be achieved in several ways.
The first approach is with a method provided by the igx-grid component to navigate to a given row. This method is navigateTo which is passed the row index to scroll to. However, with this approach, the scrolled row will be at the bottom of the grid.
The following approach uses the default row height and scroll position of the scroll. To begin with, we take the default row height with the grid's defaultRowHeight property, then multiply that height by the index of the row to scroll to. Finally, we use the row's verticalScroll and scrollPosition, setting it to the number obtained from the multiplication. With this approach, the scrolled row will be at the top of the grid.
The second described approach can be observed here:
In addition, I have prepared small sample illustrating this behavior which could be found here. Please test it on your side and let me know how it behaves. If this is not an accurate demonstration of what you are trying to achieve, please feel free to modify it and send it back to me along with steps to reproduce. Alternatively, if the behavior cannot be replicated, please feel free to provide your own sample.
If you require any further assistance on the matter, please let me know.
Regards,
Georgi Anastasov
Entry Level Software Developer
Infragistics
0
Vanessa Hand
answered on Oct 11, 2022 1:38 PM
Georgi, Great answer, thank you very much
0
Ted Herrlich
answered on Nov 26, 2024 8:42 PM
This code worked great to go to a specific record. It always bring it to the top of the visible grid. However, if the row contains a boolean checkbox and all you want to do is change its values — the action to click the box shifts the row to the top of the visible grid — and the subsequent click to change the value of the checkbow ends up changing the checkbox of a different row. Is there a way to not navigate to the row if the row is already in the visible portion of the gid?
0
Klaus Rambow
answered on Oct 9, 2022 10:07 PM
Hello Georgi,
thank you for your fast response. Your answer and your sample is excellent,
Thank you for your efforts, Klaus
0
Georgi Anastasov
answered on Oct 10, 2022 6:15 AM
Hello Klaus,
I am glad that you find my suggestion helpful.
Thank you for using Infragistics components.
Regards,
Georgi Anastasov
Entry Level Software Developer
Infragistics
0
Ted Herrlich
answered on Jun 2, 2023 2:28 PM
HI,
I was wondering how to make this navigation work for a paginated grid if the record is not on the currently visible page?
0
Joshua Patton
answered on Jun 29, 2023 10:11 AM
[quote user=”BB1EF62F2FBF95F6B2F6674A05012AABEA41D9BB”]I was wondering how to make this navigation work for a paginated grid if the record is not on the currently visible page?[/quote]