I'm trying to create a user control which will have a label and XamMultiColumnComboEditor. However the issue I'm running into is exposing XamMultiColumnComboEditor.Columns so programmers can specify which columns to show and hide. Is there a way to do that? It didn't like using this:
public ComboColumnCollection Columns { get { return (ComboColumnCollection)GetValue(ColumnsProperty); } set { SetValue(ColumnsProperty, value); } }
public static readonly DependencyProperty ColumnsProperty = DependencyProperty.Register("Columns", typeof(ComboColumnCollection), typeof(MultiColumnDropdownList), new FrameworkPropertyMetadata(null));
Hello Yanko,
thank you very much.
Your solution worked for me!
Best regards,
Jochen
Hello Jochen,
I have been looking into your requirement and I am attaching a sample application(MultiComboAsEditor.zip) that show how you can achieve the desired functionality.
Let me know, if you need any further assistance on this matter.
Hello,
i'm trying to do the exact same thing (building a User Control with XamMultiColumnComboEditor and bind the Columns property to the templated parent), but i wasn't able to accomplish that.
I attached an example which should explain all.
Thanks,Jochen
This helped, thanks.
I have been looking into your post and I assume that the setter is not working in your implementation because the ‘Columns’ property by default is read-only. You can try add manually items into your column property like e.g. :
public ComboColumnCollection Columns
{
get { return (ComboColumnCollection)GetValue(ColumnsProperty); }
set
SetValue(ColumnsProperty, value);
((this.Content as Grid).Children[0] as XamMultiColumnComboEditor).Columns.Clear();
foreach (var item in value)
((this.Content as Grid).Children[0] as XamMultiColumnComboEditor).Columns.Add(item);
}
If this does not meet your scenario, please attach a sample application in order to see your current implementation and provide you with more accurate assistance.