XtraTreelist selection issue, mutliple unexpected events triggered

751 views Asked by At

I have a treelist with check boxes for selection.

I have attached an event attached for this list which triggers when the datasourse or any value changed.

When i click on the checkbox the event triggers which is fine but when i just click on the row (not on the checkbox) still the event is triggered.

I want the triggering to happen only when i click on the checkbox.

Is there any property which i can set for the triggering to happen only during the checkbox click?

1

There are 1 answers

0
Marco Medrano On

Try use the event in the 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

Before in the method:

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