Question

I have a table in database with columns as:

CategoryId
CategoryName
ParentCategoryId
CategoryPath

The CategoryPath will have the values only when it is a child element. Now to populate the treeviewlist i have written the following code:

DataTable dt = d.CategoryGet(new System.Collections.Hashtable());
treeList1.DataSource = dt;
treeList1.KeyFieldName = info.CategoryParameters.CategoryId.ToString();
treeList1.ParentFieldName = info.CategoryParameters.ParentCategoryId.ToString();

treeList1.PopulateColumns();
treeList1.BestFitColumns();
treeList1.ExpandAll();

treeList1.FocusedNode = treeList1.Nodes[0];

For the CategoryPath column, I want to add an image which will open the file dialog box from wherein user can select the file name and that full path will be saved in the database.

Can you please suggest what to do so that where there is path it should appear in the column along with the image button to change the path; Also the image should appear when a user wants to assign a new path for the child elements where path is not yet specified.

Any help would be much appreciated.

Était-ce utile?

La solution 2

Found the solution from the devexpress site. The url is: https://www.devexpress.com/Support/Center/Question/Details/Q562627

Autres conseils

What about to use ButtonEdit for this?

here is an example http://documentation.devexpress.com/#WindowsForms/clsDevExpressXtraEditorsButtonEdittopic

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top