Drag and drop reorder rows in UltraGrid

I have an ultragrid that we drag and drop items into. Is it possible in an ultra grid to know where the user drags the item to in order to position it above/below existing rows or even click and drag existing rows to re-position them?

Any direction would be appreciated!

UIElement uieOver = grd.DisplayLayout.UIElement.ElementFromPoint(grd.PointToClient(new Point(args.X, args.Y)));
			UltraGridRow rowOver = uieOver.GetContext(typeof(UltraGridRow), true) as UltraGridRow;
			UltraGridColumn colOver = uieOver.GetContext(typeof(UltraGridColumn), true) as UltraGridColumn;
			UltraGridCell cellOver = uieOver.GetContext(typeof(UltraGridCell), true) as UltraGridCell;
1 Like

Awesome. Thank you Daryl! That got me started perfectly!

1 Like

What is the grid displaying? We were trying to use something like this in Epicor to sequence jobs by resource group.

I built a custom scheduler for our projects, we have grids of resources that can be dragged and assigned to our jobs. Order of these resources matter to us, so we will need to reorder the grid to show certain resources at the top.

That is interesting. We want to order operations for resource groups in a certain order to help flow. Do you save the grid values to a UD table?

Originally I had it actually being scheduled to jobs using BO in Epicor (50 Projects, 250 jobs, 4 resources per job - this would take hours and sometimes crashed). Eventually I switched it to a UD table instead to speed it up to 5 seconds.

Are you writing start dates back to the job operations after you set the order in the UD tables?

In my case there is no need to write back to the job. But it wouldn’t be a difficult thing to code.