views:

790

answers:

5

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

A: 

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 :)

Dolph
Please see update in question. This is for sure an ultrawebgrid feature. I went back to our old product version (with thew same ultrawebgrid) and took the screenshot.
Ron Harlev
I was going to ask for a screen shot, but figured you wouldn't be able to provide one. That's definitely what I was thinking of though. Hopefully someone else will recognize the feature! Sorry I couldn't be of more help!
Dolph
A: 

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

RobertTheGrey
Looks like your code is adding a tooltip on the column itself. Even though it looks this way in the screenshot, it is actually displayed while dragging the scroll bar. Not sure this will give the wanted effect. I might be able to check in the morning.
Ron Harlev
Yes - I was thinking about hovering over the column that contains the tooltip and using teh mousewheel to scroll thereby creating the effect. You could also think about triggering the hover events in line with the scollbar position. I'll give it a try when I'm at my machine with infragistics on it.
RobertTheGrey
A: 

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

RobertTheGrey
Looked promising at first. But my version doesn't have Override on the DisplayLayout. Also I can't find any documentation online that will show the TipStyleScroll exists on the web grid. Looks like it is only on the web grid :(
Ron Harlev
Which version do you have? Perhaps I can help then. Does my final answer help at all?cheers, Rob
RobertTheGrey
I have 6.3.20063.1056The DLL is Infragistics2.WebUI.UltraWebGrid.v6.3.dll
Ron Harlev
A: 

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

RobertTheGrey
+4  A: 

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

RobertTheGrey
I have "XmlLoadOnDemandType="Virtual" on the ascx side.I appreciate the effort Rob.
Ron Harlev
Did you have a look at the running sample in the link? Did the tooltip show up in your browser on the "virtual" example. Just trying to eliminate a browser issue
RobertTheGrey
Another thing - presumably you took the screenshot above from a working example - could you view source on that and paste it here or send to me in an email and we can perhaps reverse engineer it. It that website you took the screenshot from is built with version 6.3, then it *must* be possible. Re-check the version on that site to be safe ok?
RobertTheGrey
It was version 6.3 on the old product too. Emailed you the file
Ron Harlev
OK - I've had a look at the file you sent, and to be honest, trying to nail the small feature you're looking for is going to be best done as a prototype. I would recommend that you fire up a blank ASP.Net project and throw a grid on there from version 6.3. Then change the XMLLoadOnDemandType to Virtual, and generate 1000 rows. Then have a look to see if your tooltip shows (In diff browsers). If not, then you know to fix that first. If it shows, then you can look deeper into the ascx version. Sound like a plan?
RobertTheGrey
I've checked the docs for version 6.3 and it *should* work. Unfortunately I don't have a copy of the 6.3 dll plus licence so I can't build the prototype myself, but the one I built with my version 7.2 does work and they are very similar. That line of code above is from my prototype and it works perfectly in FF and IE, but not Chrome. There is nothing else to my prototype except plumbing code to get the grid on and generation of 1000 rows. Good luck!
RobertTheGrey
Since I am running the grid in "virtual" mode all this time, I'm guessing there is something else that is blocking the tooltip. I will look later today at event handlers that might be blocking it.Thanks Rob for all your help.
Ron Harlev
No problem - if you do manage to figure it out (or at least get a simple prototype going) let me know how you did it - otherwise I'll try again if I can find my old copy of 6.3 lying around somewhere...All the best.
RobertTheGrey