private void BarButtonItemDown_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (_selectedRecord.ID != 0) { RelatedProduct nextProduct = (RelatedProduct)GridViewLookup.GetRow(GridViewLookup.FocusedRowHandle + 1); nextProduct.Position -= 1; _selectedRecord.Position += 1; } }
private void BarButtonItemUp_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (_selectedRecord.Position == null || _selectedRecord.Position > 0) { var prior = GridViewLookup.GetRow(GridViewLookup.FocusedRowHandle - 1); if (prior != null) { RelatedProduct priorProduct = (RelatedProduct)prior; if (priorProduct.Product_Code == _selectedRecord.Product_Code && priorProduct.Product_Type == _selectedRecord.Product_Type && priorProduct.Position != null) { priorProduct.Position += 1; } if (_selectedRecord.Position != null) { _selectedRecord.Position -= 1; } } } }