回复 17楼moonlight108的帖子
试试通过2个按钮触发事件--JavaScript的排序。
每个UserControl需要设置一个ID,则UserControl的Spread控件的ID就固定了,如:Chiffrier1_FpSpread1
- protected void Page_Load(object sender, EventArgs e)
- {
- Chiffrier2 t = Page.LoadControl("Chiffrier2.ascx") as Chiffrier2;
- t.ID = "Chiffrier1"; //Spread 1
- }
- //动态增加第二个Spread的UserControl
- protected void Button1_Click(object sender, EventArgs e)
- {
- // Page.Form.Controls.Add(Page.LoadControl("Chiffrier2.ascx"));
- Chiffrier2 t = Page.LoadControl("Chiffrier2.ascx") as Chiffrier2;
- t.ID = "Chiffrier2"; //Spread 2
- Page.Form.Controls.Add(t);
- }
复制代码
- function Button2_onclick() {
- var spread = document.getElementById("Chiffrier1_FpSpread1");
- spread.SortColumn(1);
- }
- function Button3_onclick() {
- var spread = document.getElementById("Chiffrier2_FpSpread1");
- spread.SortColumn(1);
- }
复制代码
SP7.3_web - 副本.rar
(2.83 MB, 下载次数: 406)
|