oTrans.Refresh on Order bug when using List view

So I found an odd bug in Classic I’m able to reproduce in an out of the box Epicor environment where if you use the Line List to navigate to an Order Line other than the first line, then trigger some event in the customization that calls an oTrans.Refresh(), it will pull you back to line 1. This does not happen if you navigate using the tree view or the line number buttons on the detail, it will refresh and keep you on the same line.

Since it is unlikely Epicor is going to fix this since it’s in Classic menus. Is there a way to programmatically change the line you are currently on in the order?

You would have to keep track of what was in focus… I guess, then before the otrans.refresh is fired remember the indexed row in the grid then set it again after the refresh.

You see this sort of behaviour on dashboards as well.

I attempted to set the Active row on the grid to the row I want, and it moves it in the grid, but the line does not show the relevant data.
I also tried setting the row as Selected and Activated, but it also did not trigger the line detail to reset.

Actually I think it would need to be the SysrowID of the the row in question you would need and then you would have to find that record and select the row. You would have to use the trick of disabling screen updates while you search and select which I think is

SuspendRowSynchronization()

and 

ResumeRowSynchronization()

Here is a link to a related post… This might put you in the right direction.

This might also help UltraGrids are a dark art…I don’t do them enough.

https://www.infragistics.com/community/forums/f/ultimate-ui-for-windows-forms/66384/preserve-selected-row-after-data-refresh

I believe I found my solution here How to set in code the EpidataView record being CurrentDataRow - #8 by Hogardy

I did change this a little to be more efficient.

int indexDtl = edvOrderDtl.dataView.Table.AsEnumerable().Select(row => row.Field<int>("OrderLine")).ToList().FindIndex(col => col == currLine);
edvOrderDtl.Row = indexDtl;
1 Like