Wpf datagrid which rows are visible




















Everything else is too complex. Shouldn't be a problem with a proper view model. Add a comment. Active Oldest Votes. Improve this answer. Much simpler approach than using the DataTrigger. This one works for me than DataTrigger.

Ben Ben 1, 10 10 silver badges 10 10 bronze badges. Could you provide some example, please? ClarkKent: I think this blog post is a good tutorial, and has downloadable source too. Sign up or log in Sign up using Google.

Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. Ideally I would like to be able to wire up an event to know when the user is scrolling and on scroll, check what the top visible row is in order to update some information.

How about subscribing to the ScrollViewer. The event arguments for it are pretty extensive, describing how much the ScrollViewer moved and what its new Vertical offset is.

Also, according to MSDN:. Login using GitHub Register. Ask a Question. Please log in or register to add a comment. Please log in or register to answer this question. If you still disagree, please post a question Meta Stack Exchange instead of starting a rollback war. DannyBeckett, before it was a clean step-by-step guide I agree with somewhat bad language and I am sure upvotes were given at that time.

I run now into same problem and when trying this answer in current state I fail to make it working and even downvoted it. Then I spot your edit and read original answer, which is waaay more clear. Let's leave it as it is. Future readers will see my comment anyway but not all of them will be able to see revisions I guess, not my problem ;.

How do you get mHorizontalScrollBar? Sinatr Sinatr The correct index of the last row is calculated using int scroll. ViewportHeight - 1; — Parisa.

Bob King Bob King I've gotten around it by just scaling up what is in the grid fonts mainly using animations. Not quite as simple, but basically what I wanted. I ran into an issue with scaling the font, that when scaling the font down the columns won't auto resize so they are still width of the bigger font size.

There's sadly a bug in the current build of the WPFToolkit that makes auto resize columns work strangely when they're mixed with Star sized columns. We see that behavior as well, and we've just never bothered to fix it. Thanks, actually if my above comments make no sense it was because I've been working on two separate issues, one with trying to figure out the top row and the other with zooming a datagrid.

I gave up on the top row thing and told the user they would need to adjust the UI. Maybe a late answer, maybe not the best way but one of the simplest.

ScrollIntoView grdPatients. UpdateLayout ; grdPatients. SelectedItem ; grdPatients. Coskun Ozogul Coskun Ozogul 1, 1 1 gold badge 15 15 silver badges 25 25 bronze badges.



0コメント

  • 1000 / 1000