Search code examples
visual-studiodebuggingdatatip

Navigating within Visual Studio DataTip


When a DataTip is open while debugging in Visual Studio it appears the only way to get to a specific object property is scrolling with the mouse.

This can get very cumbersome as some objects can have hundreds of properties and scrolling to a property near the bottom takes a long time.

Yes, I know I can scroll faster if I hover the mouse over the bottom edge and pin a property once I found it but it can still take a long time to get to the property and pin it.

I've tried various combinations with Ctrl and Alt but what ever key I press the DataTip is promptly closed...


Solution

  • Once the DataTip has focus, you don't have to use the mouse. You can use the PgUp/PgDn (Page Up/Page Down) keys on your keyboard. But you're right: There is not a way to get to the end of the list or to get to items that start with a certain letter. When I need to do that often I take one of two approaches:

    1. If possible, I create a [temporary] variable assignment after the code-line of interest and ensure that the variable gets assigned to the property of interest.

    2. Create a watch variable and interact with that.

    3. Open an Immediate Window and paste a copy of the object-instance name in question. Once in the Immediate Window, IntelliSense is available as soon as you type the "."--you can then type the letter of the property in question and drill-down as needed more quickly.

    (Probaby the best tip!)

    1. Open (and keep open for convenience) a Debug | Windows | Autos and/or Debug | Windows | Locals window. Those windows simplify navigating variables near the code break or in the current module--and they even seem to retain their tree-node-expanded state in some cases while debugging. More information is available here: https://msdn.microsoft.com/en-us/library/bhawk8xd.aspx