I use Difference class as my datasource in treelist. Then I would like to show different icon with node according to property value of the type Difference. Here is my Code:
treeList1_GetStateImage(object sender, DevExpress.XtraTreeList.GetStateImageEventArgs e)
{
TreeListColumn tlColumn = treeList1.Columns["DifferenceType"];
DifferenceTypeEnum differenceType = (DifferenceTypeEnum)e.Node.GetValue(tlColumn);
switch (differenceType)
{
case DifferenceTypeEnum.Added:
e.NodeImageIndex = 0;
break;
case DifferenceTypeEnum.Deleted:
e.NodeImageIndex = 1;
break;
case DifferenceTypeEnum.Modified:
e.NodeImageIndex = 2;
break;
default:
throw new Exception("Difference with not specified type");
}
I would like to have the same icons when selected and when not selected and thats all, nothiung else, but now each time I click on a node NodeImageIndex is changed to 0, WHen nodes arent selected everything work fine,
ehh Im tired of this ...
thanks for any help