14 Answers, 1 is accepted
With the current implementation of RadTreeListView and the internal structure of TreeListViewRow you cannot directly change the postion of the ExpanderButton and the space around it on the different levels. I strongly recommend to use the default behavior of the TreeListViewRow.
Vanya Pavlova
the Telerik team
I personally need decrease the indention to almost nothing as it is way to much on a hierarchy as deep as the one currently have to deal with it shows a lot of wasted space, and it would be really nice to be able to control this.
Please someone at Telerik show us the secret sauce on indention for the RadTreeListView.
Due to the template structure of the RadTreeListView this could not be implemented. Unfortunately there is not a "How to".
Greetings,Didie
the Telerik team
As a kind of follow up just to let you know that RadTreeListView exposes a HierarchyIndent property, which you can use to control the horizontal indent of nested items.
Have a great day!
Regards,
Vanya Pavlova
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
I am posting here the answer provided in the support thread:
Generally, you can set RadTreeListView's HierarchyIndent property in order to control the horizontal indent of nested items. As it turns out it does not work properly hiding the indent at all. Would you please share why do you need to remove the indentation? In case you need a Flat structure, I would suggest you using RadGridView instead.
Regards,
Dimitrina
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Thanks for talking with them and providing their response.
I would have to say that removing the indent of nested items should be allowed because its WPF, and you can really do anything with it one way or another. Also you are imposing your judgements on how another developer wants to use a control. They could have 10 good reasons why they want to use it in a way that the vendor does agree with, however the vendor shouldn't not block their customers from innovating or allow them to use the controls in a new previously on thought of way that works in the way the customers needs or wants it to.
Suggesting that you should use a GridView instead of a TreeListView, is like say use a ListView and use a data template and styling to make it look like a GridView. It shouldn't really matter why a customers wants to do something a vendor didn't think about with their controls, the vendor should just be helping to facilitate the needs of the customer.
Don't get me wrong there is nothing wrong with suggesting to use alternative controls to solve a presented customer problem so as long as you also provide the solution to what they customer wanted as well along with it. This will allow the customer to review both options to see which one is best for their situation. The customer may then take your recommendation to use another control they didn't think about or they may take the solution they asked for. Either way you made a customer happy and solved their problem, the alternative is you are not solving their problem and frustrating them if they feel you are trying to force them in a direction they may not agree with or be ready to look at.
Thank you for sharing your feedback. It is indeed reasonable and client oriented and we will do our best to further improve our service.
As to the particular issue, this seems to be a missing functionality with RadTreeListView control which we should consider and investigate further. I have logged it into our feedback portal, so that other clients can also follow its progress: Controlling horizontal indent of nested rows.
Regards,
Dimitrina
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
An inelegant hack to solve this problem is to dynamically adjust the margins in the CellLoaded event. This worked for me.
private
void
_treeView_CellLoaded(
object
sender, Telerik.Windows.Controls.GridView.CellEventArgs e)
{
var cell = e.Cell;
if
(cell !=
null
&& cell.ParentRow !=
null
)
{
var rowItem = cell.ParentRow.Item
as
MyRowType;
if
(rowItem !=
null
)
{
// shift all cells to the left
cell.Margin =
new
Thickness(-_treeView.HierarchyIndent, 0,
_treeView.HierarchyIndent, 0);
}
}
}