I am using DevExpress TreeList
. I have read this article and followed the steps.
ImageList
and added icons init.SelectImageList = ImageList
TreeList.ImageIndexFieldName = "ImageID"
DataTable
is assigned to TreeList.DataSource
Table is given below
ID Name Parent ImageID
1 Root 0 0
2 Node1 1 1
3 node2 2 2
4 node3 2 2
The Problem is TreeList
is showing same icon with each node.
I found the problem in this, problem was in the data type.
While adding columns in datatable just mention its type.
dt.Columns.Add("Parent", typeof(decimal));
dt.Columns.Add("ImageID", typeof(decimal));