gpt4 book ai didi

DevExpress XtraGrid RepositoryItemButtonEdit 事件未触发

转载 作者:行者123 更新时间:2023-12-04 13:33:00 28 4
gpt4 key购买 nike

我在 gridview 中添加了一个新的 ButtonEdit 列,我将按钮变成了 ImageButton。我添加了 button_click 事件,但事件没有触发。
我应该绑定(bind)-未绑定(bind)到我的列按钮吗?

以下是属性:

        // 
// gvPrompt
//
this.gvPrompt.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
this.gcID,
this.gcName,
this.gcPromptFileName,
this.gcTypeName,
this.gcDomainName,
this.gcPromptText,
this.gcLanguage,
this.gcPromptPlayType,
this.gcDuration,
this.colPlayPrompt});
**this.gvPrompt.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;**
this.gvPrompt.GridControl = this.gcPrompt;
this.gvPrompt.Name = "gvPrompt";
this.gvPrompt.OptionsBehavior.AllowAddRows = DevExpress.Utils.DefaultBoolean.False;
this.gvPrompt.OptionsBehavior.AllowDeleteRows = DevExpress.Utils.DefaultBoolean.False;
this.gvPrompt.OptionsBehavior.Editable = false;
**this.gvPrompt.OptionsBehavior.EditorShowMode = DevExpress.Utils.EditorShowMode.Click;**
this.gvPrompt.OptionsCustomization.AllowGroup = false;
this.gvPrompt.OptionsSelection.EnableAppearanceFocusedCell = false;
this.gvPrompt.OptionsView.ShowGroupPanel = false;
this.gvPrompt.RowHeight = 3;
**this.gvPrompt.ShowButtonMode = DevExpress.XtraGrid.Views.Base.ShowButtonModeEnum.ShowForFocusedRow;
this.gvPrompt.FocusedRowChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventHandler(this.gvStep_FocusedRowChanged);**


//
// colPlayPrompt
//
this.colPlayPrompt.Caption = "Çal";
this.colPlayPrompt.ColumnEdit = this.repositoryItemButtonEdit1;
this.colPlayPrompt.FieldName = "Column";
this.colPlayPrompt.ImageAlignment = System.Drawing.StringAlignment.Center;
this.colPlayPrompt.Name = "colPlayPrompt";
**this.colPlayPrompt.ShowButtonMode = DevExpress.XtraGrid.Views.Base.ShowButtonModeEnum.ShowAlways;**
this.colPlayPrompt.Visible = true;
this.colPlayPrompt.VisibleIndex = 9;
this.colPlayPrompt.Width = 86;



//
// repositoryItemButtonEdit1
//
this.repositoryItemButtonEdit1.Appearance.Image = global::Digiturk.Diva.Management.Properties.Resources._1358361116_youtube;
this.repositoryItemButtonEdit1.Appearance.Options.UseImage = true;
this.repositoryItemButtonEdit1.AutoHeight = false;
serializableAppearanceObject2.Options.UseImage = true;
this.repositoryItemButtonEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "", 1, true, true, false, DevExpress.XtraEditors.ImageLocation.MiddleCenter, global::Digiturk.Diva.Management.Properties.Resources._1358361116_youtube, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject2, "", null, null, true)});
this.repositoryItemButtonEdit1.ButtonsStyle = DevExpress.XtraEditors.Controls.BorderStyles.Style3D;
this.repositoryItemButtonEdit1.Name = "repositoryItemButtonEdit1";
this.repositoryItemButtonEdit1.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor;
**this.repositoryItemButtonEdit1.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(this.repositoryItemButtonEdit1_ButtonClick);
this.repositoryItemButtonEdit1.ButtonPressed += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(this.repositoryItemButtonEdit1_ButtonPressed);
this.repositoryItemButtonEdit1.Click += new System.EventHandler(this.repositoryItemButtonEdit1_Click);**

我得到了可能阻止事件触发的可疑属性的粗体线?

谢谢你的帮助。
问候,
西哈特

最佳答案

当 View 不可编辑时,您无法单击 ButtonEdit 按钮,因为在这种情况下仅绘制了编辑器但未调用该编辑器。

设置gvPrompt.OptionsBehavior.Editable属性(property)给 true .然后,设置每一列的(除了带有 ButtonEdit 的列)GridColumn.OptionsColumn.AllowEdit属性(property)给 false .它允许带有 ButtonEdit 的列是可编辑的,并且编辑器的按钮是“可点击的”。

也请删除 this.gvPrompt.OptionsBehavior.EditorShowMode = DevExpress.Utils.EditorShowMode.Click;线。它允许按钮编辑立即对鼠标单击使用react,而不是首先聚焦单元格。

关于DevExpress XtraGrid RepositoryItemButtonEdit 事件未触发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16831600/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com