Question

I once saw this feature in action but I don't know how to turn it on. The grid can show a tooltip with the current row number (or row ID) while dragging the scrollbar. This helps you to stop the scroll in the right place. I'm assuming some property will turn this on, but I can't find it. Maybe it is also dependent on the scroll mode?

UPDATE: In the image below you can see an example of the tooltip I'm looking for. This is displayed while the scrollbar is being dragged (up or down). The number in the tooltip is the row number (you can't see it in this image, way to the left in the grid). This is the same grid that I am using now. Just from a very old build of our product. Somehow this tooltip was turned off. And no one knows how to turn it back on :( I'm pretty sure this is a built in feature of the ultrawebgrid. Not something that required extra coding.

alt text http://img138.imageshack.us/img138/6337/croppercapture.jpg

Was it helpful?

Solution

Right! Now that we've established that you have version 6.3, I've hopefully got a solution for you. I don't have 6.3 myself, but I've got a slightly later one that I think didn't have Virtual Scrolling added as a feature yet.

So try this code:

webgrid.DisplayLayout.XmlLoadOnDemandType = XmlLoadOnDemandType.Virtual;

This should automatically put a tooltip on the grid as you scroll down. Have a look here for a running sample... (and remember to choose the virtual option)

Here's hoping!

Rob G

OTHER TIPS

I don't know if there's a UltraWebGrid property to simply turn on the behavior you're looking for. I almost suspect you experienced this feature in another application, perhaps not even a web based one (sorry!). I do however, know exactly what you're talking about.

As a work-around, I would suggest allowing the user to input the destination row number, and to simply "jump" to it, using this technique.

If that doesn't satisfy you, it may be possible to achieve this behavior with JavaScript. You would need to use something like this technique to get the information you need, estimate (or actually detect, if possible) the row number, and the rest is up to the GUI. I would go with the work-around described above though :)

I'm typing this from memory here as I don't have it installed on this machine and I haven't seen that setting before, but how about adding something like this to the InitializeRow event:

foreach (UltraGridCell cell in e.Row.Cells)
{
    if(cell.Column.Key == "Topic") //from your grid above
       cell.Title = cell.Row.Index;
}

The row object itself does not have a "Title" property from memory, but the cell does.

See if that works...

Regards,
Rob G

OK - I think I've found your illusive setting:

You can set the TipStyleScroll on the Override to Show on the Grid (this may be version dependant).

You can determine which field is displayed as the tooltip by using the ScrollTipField property of the band.

I did it like so:

        myGrid.DisplayLayout.Override.TipStyleScroll = TipStyle.Show;
        myTopBand.ScrollTipField = "Id";

...and it works like a charm!

If it's a really long list, sometimes setting the ScrollStyle to Deferred helps:

        myGrid.DisplayLayout.ScrollStyle = ScrollStyle.Deferred;

Hope that helps...

Rob G

Once again - not sure which version you have, so to be safe here's somthing you can try from 2009 version:

myGrid.Behaviors.VirtualScrolling.Enabled = true;
myGrid.Behaviors.VirtualScrolling.TooltipVisibility = DefaultableBoolean.True;

If your scrolling mode is Deferred instead of Virtual, then the tooltip is normally enabled by default.

You can find full details about this feature here

Hope that helps,

Rob G

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top