Hello,
I'd like to change between the cardview and the normal view of the grid. The cardview is set to "band.CardSettings.MaxCardAreaCols = 1;", only one card is shown in the cardview mode. Unfortunately, it is not the selected row in the normal view, but always the first row of the grid.
Is it possible to get the following behaviour?
Thanks!
You will want to use the AfterCardsScroll event of the Ultragrid - Here is sample code
Private Sub UltraGrid1_AfterCardsScroll(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.AfterCardsScrollEventArgs) _ Handles UltraGrid1.AfterCardsScroll ' Turn off any previously Selected ActiveRow If Me.UltraGrid1.ActiveRow.Selected = True Then Me.UltraGrid1.ActiveRow.Selected = False ' Set the active row to the FirstVisibleCarRow (this works because you only have 1 card in View) Me.UltraGrid1.ActiveRow = e.Rows.FirstVisibleCardRow ' Now Select the Active Row Me.UltraGrid1.ActiveRow.Selected = True End Sub
However, this really only address part of what you want to do, if your grid rowsrequire more than one screen, the selected row may not be on the current screen viewBut there is a solution, for that I refer you to:
Knowledge Base Article: KB01926HOWTO:UltraWinGrid Scrolling Parent Row to Top of Grid