0

asp.net ウィザード コントロールがあります。いくつかのテキストボックスを持つデータグリッドを使用して、ステップ 3 でユーザー入力を取得しています。グリッドには、いくつかの関連情報で満たされたラベルもあります。4 番目のステップでは、入力を処理し、いくつかの構成を作成します。

ここで、ステップ 3 の後とステップ 4 の前に、入力情報 (テキストボックスとラベル) を含む情報の要約を表示する必要があります。要約用の新しいウィザードステップを作成して、このすべての情報を表示できますが、同様の種類の情報を作成する必要があります。ステップ3のすべての情報を入力することにより、データグリッド/(または他の方法)。代わりに、ステップ3のデータグリッドをテキストボックスとともにいくつかのラベルとともに追加して再利用し、要約ステップ中にのみ表示できます。しかし、それを行うには、次のボタンのクリック中に現在のステップをキャンセルする(e.cancel = true)などのウィザードの概念に違反し、同じステップを再度リロードするためのフラグを設定する必要がありますが、これは適切ではないと感じています仕方。

これを達成するためのより良い方法はありますか?質問がわかりにくい場合は申し訳ありませんが、クエリに基づいてさらに情報を追加できます。

4

1 に答える 1

0

現在のウィザードに組み込む場合は、ActiveStepChangedイベントを手動で処理し、ウィザードの履歴を使用してロードするステップを決定する必要があります。

これにより、最後にアクセスしたステップが取得されます。

/// <summary>
/// Gets the last wizard step visited.
/// </summary>
/// <returns></returns>
private WizardStep GetLastStepVisited()
{
    //initialize a wizard step and default it to null
    WizardStep previousStep = null;

    //get the wizard navigation history and set the previous step to the first item
    var wizardHistoryList = (ArrayList)wzServiceOrder.GetHistory();
    if (wizardHistoryList.Count > 0)
        previousStep = (WizardStep)wizardHistoryList[0];

    //return the previous step
    return previousStep;
}

これは、あなたがやろうとしていることと似ている、少し前に書いたロジックです。

/// <summary>
/// Navigates the wizard to the appropriate step depending on certain conditions.
/// </summary>
/// <param name="currentStep">The active wizard step.</param>
private void NavigateToNextStep(WizardStepBase currentStep)
{
    //get the wizard navigation history and cast the collection as an array list 
    var wizardHistoryList = (ArrayList)wzServiceOrder.GetHistory();

    if (wizardHistoryList.Count > 0)
    {
        var previousStep = wizardHistoryList[0] as WizardStep;
        if (previousStep != null)
        {
            //determine which direction the wizard is moving so we can navigate to the correct step
            var stepForward = wzServiceOrder.WizardSteps.IndexOf(previousStep) < wzServiceOrder.WizardSteps.IndexOf(currentStep);

            if (currentStep == wsViewRecentWorkOrders)
            {
                //if there are no work orders for this site then skip the recent work orders step
                if (grdWorkOrders.Items.Count == 0)
                    wzServiceOrder.MoveTo(stepForward ? wsServiceDetail : wsSiteInformation);
            }
            else if (currentStep == wsExtensionDates)
            {
                //if no work order is selected then bypass the extension setup step
                if (grdWorkOrders.SelectedItems.Count == 0)
                    wzServiceOrder.MoveTo(stepForward ? wsServiceDetail : wsViewRecentWorkOrders);
            }
            else if (currentStep == wsSchedule)
            {
                //if a work order is selected then bypass the scheduling step
                if (grdWorkOrders.SelectedItems.Count > 0)
                    wzServiceOrder.MoveTo(stepForward ? wsServicePreview : wsServiceDetail);
            }
        }
    }
}
于 2013-03-09T16:50:57.177 に答える