0

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.

Sergiu Paraschiv
  • 9,929
  • 5
  • 36
  • 47
user1254053
  • 755
  • 3
  • 19
  • 55

2 Answers2

0

What about to use ButtonEdit for this?

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

potehin143
  • 541
  • 4
  • 9
  • Thanks potehin143 for looking at my question. I don't think it will be useful, as i want a simple image which on click opens a dialog box and on selecting from that shows the text in the cell – user1254053 Jan 14 '14 at 05:27
  • potehin143 - you were right. I finally used the ButtonEdit here. – user1254053 Jan 16 '14 at 10:09
  • I have adviced ButtonEdit first of all becorse of this is more stable then any custom realisation. If you need to make fine UI try WPF. Sash things are not the problem there – potehin143 Jan 16 '14 at 10:51
0

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

user1254053
  • 755
  • 3
  • 19
  • 55