Devexpress中SearchLookUpEdit 查找按钮 事件绑定与关闭
按钮事件绑定:
void searchLookUpEdit1_Popup(object sender, EventArgs e)
void searchLookUpEdit1_Popup(object sender, EventArgs e)
{
IPopupControl popup = sender as IPopupControl;
LayoutControl layoutControl = popup.PopupWindow.Controls[2].Controls[0] as LayoutControl;
SimpleButton button = ((LayoutControlItem)layoutControl.Items.FindByName("lciButtonFind")).Control as SimpleButton;
if (button != null)
{
button.Click -= new EventHandler(buttonTest_Click);
button.Click += new EventHandler(buttonTest_Click);
}
}
绑定的事件,
private void buttonTest_Click(object sender, EventArgs e)
{
}
在绑定事件中获取检索框文本框数值:
IPopupControl popupControl = bteProjectID as IPopupControl;
DevExpress.XtraEditors.Popup.PopupSearchLookUpEditForm window = popupControl.PopupWindow as DevExpress.XtraEditors.Popup.PopupSearchLookUpEditForm;
DevExpress.XtraGrid.Editors.SearchEditLookUpPopup popup = window.Controls.OfType<DevExpress.XtraGrid.Editors.SearchEditLookUpPopup>().FirstOrDefault();
TextEdit find = popup.FindTextBox;
var value= popup.FindTextBox.EditValue.ToString();
文章讲述了如何在Devexpress的SearchLookUpEdit控件中绑定查找按钮的事件,以及在事件处理中如何获取检索框文本框的数值。通过示例代码展示了如何访问并操作控件的内部元素,包括解除和添加Click事件监听器。

3709

被折叠的 条评论
为什么被折叠?



