private void WeightedAverageHistory_Load(object sender, EventArgs e)
 {
     MovingAverageHistory history = new MovingAverageHistory();
     gridBeggining.DataSource = history.GetBeginningBalance(costElement);
     gridAllSimilarItems.DataSource = history.GetHistory(costElement);
 }
        /// <summary>
        /// Load All Neccessary Data and Bind To DataSource
        /// </summary>
        void LoadAndBind()
        {
            //Bind

            //Load Detail Table To Grid
            Item item = new Item();
            gridReceiveDoc.DataSource = item.GetReceiveDocDetailForDiagnostics(ItemId, ManufacturerId, UnitId,
                                                                               MovingAverageId);

            gridJournalEntries.DataSource = item.GetJournalEntriesForDiagnostics(AffectedLedgerID);

            MovingAverageHistory history = new MovingAverageHistory();
            CostElement costElement = new CostElement(ItemId, MovingAverageId, ManufacturerId, UnitId, ManufacturerId);
            gridAllSimilarItems.DataSource = history.GetHistory(costElement);

            //Load Header Information From first row to be displayed

                txtItemName.EditValue = Item;
                txtItemUnit.EditValue = Unit;
                txtManufacturerName.EditValue = Manufacturer;
                txtActivityName.EditValue = MovingAverage;
                txtUnitCost.EditValue = UnitCost;
                txtMargin.EditValue = Margin;
                txtSellingPrice.EditValue = SellingPrice;
        }