void OnTreeviewSelectionChanged(object sender, EventArgs e) { bool selected = ytreeviewRef.Selection.CountSelectedRows() > 0; buttonSelect.Sensitive = selected; buttonEdit.Sensitive = ButtonMode.HasFlag(ReferenceButtonMode.CanEdit) && selected; buttonDelete.Sensitive = ButtonMode.HasFlag(ReferenceButtonMode.CanDelete) && selected; }
protected void OnYtreeviewRefRowActivated(object o, RowActivatedArgs args) { if (Mode == OrmReferenceMode.Select || Mode == OrmReferenceMode.MultiSelect) { buttonSelect.Click(); } else if (ButtonMode.HasFlag(ReferenceButtonMode.CanEdit)) { buttonEdit.Click(); } }