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
350
ActiveItem jumps out of view on sorting/grouping
posted

Hi,

Users have reported unexpected behaivour when XamGrid is bound to a dynamically updating collection and sorting/grouping settings cause new items to appear above the currently displayed rows (for those appearing below, no issues reported). This behaivour makes user open context menu on the unexpected item and it is obviously not what the want.

I cannot provide sample code yet this behaivour can be easily reproduced using WPF Samples Browser - XamGrid - Editing & Selection - Active Item:

- open the sample

- click on BONAP cell

- sort by Company TWICE

- Active item window shows Laurence Lebihan, and Active Item is out of visible area.

My understanding is that ActiveItem should always be kept in the visible area.

I am using the lastest available patch for 2015.2.

I tried to use ScrollCellIntoView as a workaround but failed. Is there any way to achieve the expected behaivour?

Alex

PS. UPDATE. I've run Xceed's grid sample and they do have aforementioned functionality implemented the way users expect - even when sorting/grouping changes selected item is kept in the view. Of course, it jumps a little inside the grid's rectangle, but this is OK compared to XamGrid's scrolling out of view completely.

Parents
No Data
Reply
  • 2180
    Offline posted

    Hello Alexander,

    The xamGrid control doesn’t provide this functionality by default but you can handle the ColumnSorted event, reset the XamGrid ActiveItem and then ScrollCellIntoView(xamGrid.ActiveCell) to achieve your requirement.

    I have attached a sample application for your reference.

    Sincerely,

    ScrollIntoViewOnSorting.zip
Children