Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
395
How flexible can the WebGrid be?
posted

I found at last your "data window" example, which looks like it will help on the data side of what I wish to do.

I'm wondering in particular, though, what I can safely modify and in what events to have exacting control over the scrolling.

What I've got is a case where I have a sparse retrieval data source where I can navigate to first, previous, next and last, and it can pull in surrounding rows. I've been handling this in a standalone application by assigning behaviors to the row numbers: take the example of a 10-row grid. If you scroll to row number 1, you start at the very first row - scrolling to row number 2 is equivalent to going back ten rows from the current position, 3 = 9 rows back, etc, all the way to 11 = one row back, and then 12 through 21 are the visible rows, 22 through 31 are scrolling one through ten rows forward, and row 32 jumps to the very last record.

Those particular details aren't as important as the fact that the current row and total number of rows changes a little unpredictably. e.g. If I try to scroll up five rows, and it turns out that there were only two rows there before the beginning, then my current row will become 1 (instead of 6) and my total rows will go down by 9 (since I estimate 10 missing plus one first record). If I try to scroll up five rows, and I still haven't hit the first row, then my current row will go back to being number 12 (past my 10+1), and my total rows will increase by 5 (the ones I retrieved)

My question: Is there a way using the Infragistics grid to alter the current row number and total rows (increase *or* decrease, but the current row number will never exceed the total rows) in response to a scroll event? What event(s) would I put that in? I see that DataSourceEventArgs has a CompleteRowCount - can that be altered at will?

Just looking for a way to use my sparse retrieval technology - we've got cases where the number of rows could otherwise be in the tens of thousands, and we do not always start on the first row :)

- Ritchie Annand

P.S. Is there a good working example of the Virtual data retrieval mode that overrides some events instead of leaving them at the defaults?

  • 395
    posted

    I've taken a further look into the Infragistics code, and it looks like I can use Javascript for some of the effects that I'm looking for. The rows have activate(), setSelected() and scrollToView() to pick a particular row, and I can try playing with the CompleteRowCount.

    What I need now is a working example of how to use the Virtual mode of the grid!

    The Scroll-On-Demand (AJAX) demo on the web features page (http://samples.infragistics.com/2008.2/webfeaturebrowser/default.htm) lets you pick Virtual with the radio button. This works fine with the scroll bar, but if you try cursoring off the bottom of the grid, you cannot cursor any more, and if you try cursoring off the top, not only can you no longer cursor around, but the grid has reset to the first row.

    Does Virtual mode work with the cursor keys? Can it be made to?

    Cheers,

    -- Ritchie Annand