BarEditItem ContentTemplate

  <dxb:BarEditItem Name="txtSearch"  >
                <dxb:BarEditItem.ContentTemplate>
                    <DataTemplate>
                        <dxe:ButtonEdit Name="btnEditEducationResources" AllowDefaultButton="False" MinWidth="200"
                                        KeyDown="btnEditEducationResources_KeyDown"
                                        MouseLeftButtonUp="btnEditEducationResources_MouseLeftButtonUp">
                            <dxe:ButtonEdit.Buttons>
                                <dxe:ButtonInfo Name="btnSearch"  >
                                    <Image Stretch="Uniform" Source="/Gemr;component/Images/16/Search_16.jpg"></Image>
                                </dxe:ButtonInfo>
                            </dxe:ButtonEdit.Buttons>
                        </dxe:ButtonEdit>
                    </DataTemplate>
                </dxb:BarEditItem.ContentTemplate>

            </dxb:BarEditItem>

 

  private void btnEditEducationResources_KeyDown(object sender, KeyEventArgs e)
        {
            ButtonEdit btnEdit = sender as ButtonEdit;
            if (btnEdit == null) return;

            if (btnEdit.EditValue == null) return;

            if (e.Key == Key.Enter)
            {
                string strKey = btnEdit.EditValue.ToString();
                if (string.IsNullOrEmpty(strKey)) return;

                this.ExecuteEducationResourcesSearch(strKey);
            }
        }

 

posted @ 2014-02-11 13:23  quietwalk  阅读(842)  评论(0编辑  收藏  举报