0
更改RepositoryItemButtonEdit中的可見性按鈕我有3列的gridView。一列已經repositoryItempictureEdit與4個EditorButtons通過點擊
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事件處理程序
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是可見的。 我如何通過用戶操作更改EditorButton的可見性(或屬性Enabled)。 (對於每一行)?
不,它不工作 –
但它的解決方案正在爲我工作。你是否已經下載並使用解決方案開始測試項目? – isxaker
我想要做的是當按下RepositoryItem時,它應該從啓用更改爲禁用。反之亦然。我的意思是使用RepositoryItemButtonEdit切換按鈕。 –