I am populating a treeview in C# from a SQL Server 2005 database.
Table tree( id int, parent_id int, name varchar(50).
The treeview is populated succesfully and when I select a node it is highlited. But if the nodename for example is 5 characters long the highlite is much longer. I think the treeview takes the width from the database table because I have already changed the varchar(50) to varschar(20) and the highlight width is smaller then, but it is still a fixed width.
What must I do so that the hightlighting is as long as the actual length of a nodename?
Table tree( id int, parent_id int, name varchar(50).
The treeview is populated succesfully and when I select a node it is highlited. But if the nodename for example is 5 characters long the highlite is much longer. I think the treeview takes the width from the database table because I have already changed the varchar(50) to varschar(20) and the highlight width is smaller then, but it is still a fixed width.
What must I do so that the hightlighting is as long as the actual length of a nodename?
Comment