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); } }