I am selecting gridview item using code, so I also need my gridview to Scrolls at selected item's position , I tried GridView.ScrollintoPosition() but it is not working . IS there any way to get the Scroll position of SelectedItem so that I can scroll it using scrollViewer1.ScrollToHorizontalOffsetWithAnimation()
How to get GridView.Selected Item's Scroll Position in Windows 8 Metro App
1.9k Views Asked by Zee At
1
There are 1 best solutions below
Related Questions in C#
- How to call a C language function from x86 assembly code?
- What does: "char *argv[]" mean?
- User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script
- How to crop a BMP image in half using C
- How can I get the difference in minutes between two dates and hours?
- Why will this code compile although it defines two variables with the same name?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Why can't I use the file pointer after the first read attempt fails?
- #include Header files in C with definition too
- OpenCV2 on CLion
- What is causing the store latency in this program?
- How to refer to the filepath of test data in test sourcecode?
- 9 Digit Addresses in Hexadecimal System in MacOS
- My server TCP doesn't receive messages from the client in C
- Printing the characters obtained from the array s using printf?
Related Questions in WINDOWS-8
- Rstudio for Windows 8.1 (64bit)?
- visual studio How do I run a windows 2008 ce Solution on VS 2017?
- How to solve a connection refused to localhost error SQLCODE -902?
- Access denied when using findstr windows command
- Signing kernel mode driver for Windows 8.1
- How to create share and grant multiple permissions on Windows8 using script
- Compiling Windows apps for other versions of Windows
- Windows 8 server , IIS 7.5 , .net version 4.6 , ASP.NET_SessionId cookies is not reflecting SameSite attribute
- HOW TO INSTALL A NODE V>14 IN WINDOWS 8?? Please someone help me
- git clone : This application requires one of the following versions of .NET Framework: .NET framework,Version =v4.7.2
- Error running WPF application using ChromiumWebBrowser from CefSharp.Wpf on Windows 8.0 SP1
- How to write programs for Windows RT?
- Flutter update causing error "Flutter requires PowerShell 5.0 or newer" irrecoverable
- Task Scheduler did not launch task "\abc" because instance "(GUID)" of the same task is already running
- VS Code Failed to Install Visual Studio Code Update
Related Questions in WINDOWS-RUNTIME
- Linker errors when adding a native c++ static library to Windows runtime component (UWP)
- Linker issues while cross compiling for ARM(arm6ec) platform
- Byte Patching using winrt api (C++)
- Associating WinRT DeviceInformation objects with WMI objects (Win32_PnPEntity)
- System.PlatformNotSupportedException error in desktop App (.NET framework) VS2019
- IAsyncOperation "Completed" handler race conditions?
- IMetaDataDispenser::DefineScope() fails with E_NOTIMPL (0x80004001)
- Why does my C++/WinRT program with an IAsyncOperation take 2 seconds longer if I remove system("");?
- Python winrt how to get notification listener permission?
- Python winrt module: MouseDevice is not activatable
- How to use a custom MediaSource for a virtual camera? Also, how and where should I register the CLSID for my virtual camera?
- WinUI3 C++ Data Binding
- How to read images from memory to ImageSource in C++/WinRT (WinUI3)?
- Does anyone know how to use the IDragDropManagerInterop interface with a desktop application?
- How can I use the system's clipboard in a winui 3 program
Related Questions in WINRT-XAML
- How can I get the screen reader to read controls that are not tab stops (e.g. static labels)?
- WinUI3 ListView Selected Items
- Get child element from a Window Handle in WinUI3
- How to create a ListBox item control and bind a complex type to
- how to get a UWP xaml control from a dll to host it in xamlisland
- WinUI3 CheckBox content style
- XAML and ViewModel Binding inside ControlTemplate
- Changing the opacity of RichEditBox SelectionHighlightColor is not working in uwp?
- Adding a WinUI/WinRT Xaml form to a standard C++ library
- WinUI 3 How to make DataTemplate usable in all pages?
- UWP "form" validation event
- Data binding through UserControl
- in c++ winrt NavigationView how do I select an item after control is populated dynamically
- How to add label to Checkbox in Windows::UI::XAML::Controls
- UWP C++WinRT How to disable a single item in a GridView
Related Questions in WINRT-XAML-TOOLKIT
- BitmapEncoder.CreateForTranscoding corrupts the png image
- setup ColumnChart from WinRTXamlToolkit
- library for drawing xy-chart in UWP
- Reverse the order of legend items in chart with a StackedAreaSeries
- How to open a xaml as a window while clicking on run button
- How to Expand and collapse WinRTXamlToolkit Treeview programmatically?
- UWP - WinRT xaml toolkit TreeView in Flyout, changes selection after flyout closes
- Hide x-Axis UWP Chart
- WinRT Xaml Toolkit Chart - Is there a maximum number of data points?
- Unable to reorder items in GridView when WrapPanel is used UWP
- How to set two-valued columns on UWP chart
- Binding Data to UWP WinRT_XamlToolKit_Chart
- How to bind to IsExpanded property - to persist the TreeView's expanded state?
- WinRT XAML toolkit lineseries chart displays wrong results
- WinRT Xaml ToolKit change Column width in Column Series
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
There are a few aspects here.
gridView.ScrollIntoView(gridView.SelectedItem)should work. It's a bit asynchronous, so the code wouldn't immediately see it scrolled, but if you do something likeawait Task.Delay(100)- you might be able to see theScrollVieweroffset updated..ScrollViewer.ScrollToHorizontalOffsetWithAnimation()extension or if you are targeting Windows 8.1 - you can use the newScrollViewer.ChangeView()method that supports animated scroll.ScrollViewerin theGridViewtemplate first. You can either do it usingGetTemplatePart()or with theVisualTreeHelper.SelectedItemin theScrollViewer. To do that you first need the container itself, which you can get usingvar container = gv.ContainerFromItem(gv.SelectedItem), but if theItemsPanelof theGridViewis virtualized - you might not be able to do that because theSelectedItemmight not have its UI container. I would simply do the non-animated scroll in that case for many reasons - mainly performance, but if you really have to - you might be able to calculate the position based on the index of theSelectedItemin the collection of items and item size, but it might be a bit complicated.var horizontalOffset = gridViewItem.TransformToVisual(scrollViewer).TransformPoint(new Point()).X;