.NET 學習

.NET 學習生活感想... 万事成蹉跎..... 贵在坚持 及时整理自己做过和学过的东西

博客园 首页 新随笔 联系 订阅 管理

1.在ViewController上添加两个ParameterAction

2.隐藏一个ParameterAction中的Action

3.实现代码:

 

 private void ParermaterViewController_ViewControlsCreated(object sender, EventArgs e)
        {
            IBarManagerHolder bmh 
= Frame.Template as IBarManagerHolder;
            
if (bmh != null && bmh.BarManager != null)
            {

                
foreach (BarItem item in bmh.BarManager.Items)
                {
                    BarEditItem eitem 
= item as BarEditItem;
                    
if (eitem != null && eitem.Tag == FromParaAction)
                    {
                        ((DevExpress.XtraEditors.Repository.RepositoryItemDateEdit)eitem.Edit).Buttons[
1].Visible = false;
                        ((DevExpress.XtraEditors.Repository.RepositoryItemDateEdit)eitem.Edit).EditMask 
= "dd/MM/yyyy";
                        eitem.Width 
= 120;
                        eitem.AutoFillWidth 
= false;
                        eitem.Caption 
= FromParaAction.Caption;
                       
                        
//eitem.Edit.EditValueChanged += new EventHandler(FromAction_EditValueChanged);
                    }
                    
else if (eitem != null && eitem.Tag == ToParaAction)
                    {
                        ((DevExpress.XtraEditors.Repository.RepositoryItemDateEdit)eitem.Edit).Buttons[
1].Visible = true;
                        ((DevExpress.XtraEditors.Repository.RepositoryItemDateEdit)eitem.Edit).EditMask 
= "dd/MM/yyyy";
                        eitem.Width 
= 140;
                        eitem.AutoFillWidth 
= false;
                        eitem.Caption 
= ToParaAction.Caption;
                        
//eitem.EditValue = DateTime.Now;
                        
//eitem.Edit.EditValueChanged += new EventHandler(ToAction_EditValueChanged);
                    }

                   
// BarButtonItem bitem = item as BarButtonItem;
                    
//if (bitem != null && (bitem.Tag == ApplyFilterAction || bitem.Tag == RemoveFilterAction))
                    
//{
                    
//    bitem.Width = 120;
                    
//}

                    
//foreach (BarItemLink itemLink in item.Links)
                    
//{
                    
//    //if (itemLink != null && (itemLink.Caption == ApplyFilterAction.Caption || itemLink.Caption == RemoveFilterAction.Caption) )
                    
//    if (itemLink != null && (itemLink.Caption == ToAction.Caption || itemLink.Caption == RemoveFilterAction.Caption))
                    
//    {
                    
//        itemLink.BeginGroup = true;
                    
//    }
                    
//}

                }
            }
        }

 

posted on 2011-03-10 12:28  Tonyyang  阅读(665)  评论(0编辑  收藏  举报
欢迎转载,转载请注明出处:http://www.cnblogs.com/Tonyyang/