共用方式為


DataRepeater.ItemCloning 事件

更新:2007 年 11 月

會在從 ItemTemplate 複製 DataRepeaterItem 及其控制項之前發生。

命名空間:  Microsoft.VisualBasic.PowerPacks
組件:  Microsoft.VisualBasic.PowerPacks.Vs (在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)

語法

Public Event ItemCloning As DataRepeaterItemCloneEventHandler

Dim instance As DataRepeater
Dim handler As DataRepeaterItemCloneEventHandler

AddHandler instance.ItemCloning, handler
public event DataRepeaterItemCloneEventHandler ItemCloning
public:
 event DataRepeaterItemCloneEventHandler^ ItemCloning {
    void add (DataRepeaterItemCloneEventHandler^ value);
    void remove (DataRepeaterItemCloneEventHandler^ value);
}
JScript 不支援事件。

備註

這個事件可以用來在複製之前執行自訂程式碼,或用來覆寫複製程序。

DataRepeaterItemCloneEventArgs 類別包含 handled 參數,會指定控制項是否要處理複製程序。如果您將 handled 設定為 true,則會覆寫預設的複製程序,因此您就必須自行處理所有的複製程序。若要在預設的複製程序啟動之前執行自訂程式碼,請將 handled 參數設定為 false。

注意事項:

如果要稍微變更複製程序,請考慮改用 ItemCloned 事件,而不要使用這個事件。

如需如何處理事件的詳細資訊,請參閱使用事件

使用權限

請參閱

參考

DataRepeater 類別

DataRepeater 成員

Microsoft.VisualBasic.PowerPacks 命名空間

ItemCloned

其他資源

DataRepeater 控制項簡介 (Visual Studio)