Hello Support,
I've been following your two tickets, the first one How to show a full member path in the LayoutControl's Customization Form to avoid similar captions for properties with the same last member, which works for DetailView and the second one How to show a full member path in the Customization Form - for list views? which solves this for a ListView. However I've not been able to find a solution which would work for a TreeList.
Here is my code sample:
C#// one mistake - the event has to be OnActivated() for grid to work
//protected override void OnViewControlsCreated()
protected override void OnActivated()
{
base.OnViewControlsCreated();
if (View is DetailView detailView)
{
((WinLayoutManager)detailView.LayoutManager).ItemCreated += CustomizationFormCaptionController_ItemCreated;
}
else if (View is ListView listView)
{
if (listView.Editor is GridListEditor gridListEditor)
{
defaultEnablePropertyPathToolTip = GridEditorColumnChooserController.EnablePropertyPathToolTip;
GridEditorColumnChooserController.EnablePropertyPathToolTip = false;
gridListEditor.CustomizeGridColumn += GridListEditor_CustomizeGridColumn;
}
else if (listView.Editor is TreeListEditor treeListEditor)
{
defaultEnablePropertyPathToolTip = TreeListEditorColumnChooserController.EnablePropertyPathToolTip;
TreeListEditorColumnChooserController.EnablePropertyPathToolTip = false;
// what to do here?
}
}
}
private void GridListEditor_CustomizeGridColumn(object sender, CustomizeGridColumnEventArgs e)
{
e.GridColumn.CustomizationCaption = CaptionHelper.GetFullMemberCaption(View.ObjectTypeInfo, e.GridColumn.FieldName);
}
private void CustomizationFormCaptionController_ItemCreated(object sender, ItemCreatedEventArgs e)
{
if (e.ViewItem is PropertyEditor)
{
e.Item.CustomizationFormText = CaptionHelper.GetFullMemberCaption(View.ObjectTypeInfo, ((PropertyEditor)e.ViewItem).MemberInfo.Name);
}
}
Could you give me an advice on how to solve this scenario for a TreeList?
Thank you.
I've made one mistake in the code example - the correct event has to be OnActivated() instead of OnViewControlsCreated() for a grid to work as intended.
Hi Lukáš,
Would you please clarify if I'm correct that you've managed to achieve the required functionality?
Hello Gosha,
I'm sorry for any misunderstanding I may have caused by my comment. I merely updated my sample code in my initial post with correct event.
My question about possible solution for TreeList is still valid.
Hello,
Thank you for the clarification. Please give us additional time to research this scenario.
Thanks,
Andrey