2011-01-25 7 views
0

私は選択のためのチェックボックスを持つtreelistを持っています。XtraTreelistの選択問題、複数の予期しないイベントがトリガーされました

データストアまたは任意の値が変更されたときにトリガーするイベントをこのリストに添付しました。

チェックボックスをクリックすると、イベントがトリガーされます。 が表示されますが、チェックボックスには表示されていない行がクリックされても、イベントは引き続き発生します。

トリガーは、チェックボックスをクリックしたときにのみ発生します。

トリガーがチェックボックスのクリック中にのみ発生するように設定できるプロパティはありますか?

答えて

1

はRepositoryItemCheckEditでイベントを使用してみてください。この方法では前

this.repositoryItemCheckEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit(); 
this.treeList.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] { 
this.repositoryItemCheckEdit1}); 
//Assign it to your column that will have the checkbox 
this.colwithCheckbox.ColumnEdit = this.repositoryItemCheckEdit1; 

//And use the event 
this.colwithCheckbox.ColumnEdit.EditValueChanging +=ColumnEdit_EditValueChanging 

void ColumnEdit_EditValueChanging(object sender, DevExpress.XtraEditors.Controls.ChangingEventArgs e) 
    { 
     //You can cancel the check event 
     e.Cancel = true; 
    } 
関連する問題