protected void btnConfirm_Click(object sender, EventArgs e)
        {
            var inventoryID = ASPxGridViewInventoryDeliveries.GetSelectedFieldValues("InventoryDeliveriesID").OfType <int>().FirstOrDefault();


            RemoveSessionsAndClosePopUP(true, inventoryID);
        }
        protected void ASPxGridViewInventoryDeliveries_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
        {
            ClearAllSessions(Enum.GetValues(typeof(Enums.InventoryDeliveriesSession)).Cast <Enums.InventoryDeliveriesSession>().ToList());

            object valueID    = 0;
            int    userAction = CommonMethods.ParseInt(e.Parameters);

            if (userAction != (int)Enums.UserAction.Add)
            {
                valueID = ASPxGridViewInventoryDeliveries.GetRowValues(ASPxGridViewInventoryDeliveries.FocusedRowIndex, "InventoryDeliveriesID");
            }

            ASPxWebControl.RedirectOnCallback(GenerateURI("InventoryDeliveriesForm.aspx", userAction, valueID));
        }