首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >通过单击更改RepositoryItemButtonEdit中的可见性按钮

通过单击更改RepositoryItemButtonEdit中的可见性按钮
EN

Stack Overflow用户
提问于 2014-02-06 14:09:29
回答 1查看 2.7K关注 0票数 0

我有3列的gridView。一个列有repositoryItempictureEdit和4 EditorButtons

代码语言:javascript
复制
this.repActionsBtn.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(),
            new DevExpress.XtraEditors.Controls.EditorButton(),
            new DevExpress.XtraEditors.Controls.EditorButton(),
            new DevExpress.XtraEditors.Controls.EditorButton()});

我有一个buttonClick事件处理程序

代码语言:javascript
复制
private void repActionsBtn_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            ButtonEdit editor = sender as ButtonEdit;

            if (editor != null)
            {
                object obj = this.mainView.GetFocusedRow();
                int id = GetValueFromAnonymousType<int>(obj, "ID");

                //undo
                if (e.Button == editor.Properties.Buttons[0])
                {
                    _ignoredIds.Remove(id);
                }
                //delete
                else if (e.Button == editor.Properties.Buttons[1])
                {
                    //HERE i want change visibility buttons
                    e.Button.Visibility = false;
                    _ignoredIds.Add(id);

                }
                //edit
                else if (e.Button == editor.Properties.Buttons[2])
                {
                    _storedIds.Clear();
                    _storedIds.Add(id);
                    this.DialogResult = System.Windows.Forms.DialogResult.Retry;
                }
                //save
                else if (e.Button == editor.Properties.Buttons[3])
                {
                    //save
                    _storedIds.Remove(id);
                }
                mainView.RefreshRow(this.mainView.FocusedRowHandle);
            }
        }

但是火重画和我得到默认的repositoryItemButtonEdit按钮是可见的。如何通过用户操作更改EditorButtons的可见性(或启用属性)。(每一行)?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-03-14 04:13:43

Devexpress支持给我一个解决方案。这里您可以找到解决方案并下载测试项目。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21605222

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档