I have a grid that only displays a single card row at a time. When the user clicks on a parent cell, the corresponding card row for that cell becomes visible below it. When the user clicks on another cell, the first card row hides and the card row corresponding to the new cell becomes visible.
I need the parent cell that corresponds with the card row to be the active row/cell, but I also need the card row to be visible to the user. The problem I'm having is, if the card row is located near the bottom of the grid, only the top of the card row is visible when the grid loads, forcing the user to scroll to see the information.
I've tried using
ugStepInfo.Rows.ScrollCardIntoView(ugStepInfo.Rows.FirstVisibleCardRow)
but it doesn't seem to do the trick.
amberfontes said:I'm thinking maybe this method was designed to work for rows displaying in standard view and has not been updated to handle card view?
That's certainly possible, but if that's the case, it's a bug. The ScrollRowIntoView method should bring the whole row into view, whether it's a card or a regular row.
I just tested this out and it seems to work fine for me. I'm attaching the sample project I used so you can see if it works for you. Just run it and click the button and the entire card is brought into view.
I think your suggestion still works, however, because I should be able to use ActiveRowScrollRegion.Scroll with the LineUp/LineDown option to move it up a little higher.
Thanks, Mike.
Mike,
Thanks for your response.
I tried this and it brings it up a little higher, exposing maybe one more row, but the entire 'card' is still not visible. I'm thinking maybe this method was designed to work for rows displaying in standard view and has not been updated to handle card view?
Hi,
I don't think the line of code you have here will do anything. In fact, I'm surprised it's not raising an exception.
FirstVisibleCardRow is only intended for use in a collection of the Cards, not a collection of regular rows, which sems to be how you are using here it.
If the card in this screen shot is a child row, and it seems that it must be, then there's nothing in the grid that will return that row via a single property settings. What you would need to do is find the row somehow and call:
this.ultraGrid1.ActiveRowScrollRegion.ScrollRowIntoView(row);
Here's an example. When this grid loads, I'm setting the active cell to $7,875.00 and then using the scroll code:
Since the card row is near the bottom of the grid, only the top is showing. I only have one set of child bands showing at a time in card view (looks like one row to the user), and the row in my screenshot is the only visible card row on the entire grid.
How can I get the entire card row to show when the grid loads? It displays fine once the user starts clicking on parent cells, but I need the entire card view section to be visible at startup even when it's at the bottom of the parent list.