本帖最后由 huaier200 于 2011-07-05 15:57:40 编辑

解决方案 »

  1.   

    1.SetFocus部分: 
     private void picAddDepartment_Click(object sender, EventArgs e)
            {
               
                Dictionary<string, string> str = new Dictionary<string, string>();
                str = this.Box.Department;
                frmSelectEmployees frmSelectEmployee = new frmSelectEmployees();            frmSelectEmployee.CurrentPartment=str;
                frmSelectEmployee.ShowDialog();            if(frmSelectEmployee.SelectedUser.Count>0)
                {
                    str["uID"] = frmSelectEmployee.SelectedIDs;
                    this.Box.Department["uID"] = str["uID"];
                    int DeptCount = Convert.ToInt32(this.Box.Department["DeptCount"]);
                    DeptCount += frmSelectEmployee.SelectedUser.Count;
                    this.Box.Department["DeptCount"] = DeptCount.ToString();
                        
                    str = this.Box.Department;
                   
                    frmSelectEmployee.addUsersToDept(str);
                    
                    this.Box.BeginLoad();
                }            this.Box.Page.FocusPool.SetFocus("CurrentTree", str);
            }2、BindFocus部分:
     protected override void OnBound()
            {
                base.OnBound();
                this.Page.FocusPool.BindFocus("CurrentTree", this, this.FocusChangedEventHandler, this.FocusChangingEventHandler);            
            }
     private void FocusChangedEventHandler(string focusKey, FocusChangedEventArgs args)
            {
                switch (focusKey)
                {
                        case "CurrentTree":
                        this.CurrentItem = args.NewFocus as Dictionary<string, string>;
                        this.BeginLoad();
                        break;
                        
                }
                
            }