PropertyGrid in ItemsControl ItemTemplate is always empty
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
No repository files or tests are named. Start by reproducing the supplied WPF ListBox and PropertyGrid XAML with the Company and ViewModel example, then trace the PropertyDefinitions binding inside the DataTemplate. Done means each PropertyGrid receives the collection and displays the Task and HeadNote properties.
Written by the indexing model from the issue text.
Description
I bind PropertyGrid(in ListBox ItemTemplate) PropertyDefinitions to a PropertyDefinitionCollection in my viewmodel, but I find the binding does not work, the PropertyDefinitionCollection of all PropertyGrid is empty, and all PropertyGrid are empty. Here is my code:
<ListBox ItemsSource="{Binding ManufacturerList}">
<ListBox.ItemTemplate>
<DataTemplate>
<xctk:PropertyGrid
SelectedObject="{Binding }"
AutoGenerateProperties="False"
PropertyDefinitions="{Binding DataContext.PropertyDefinitionCollection, ElementName=window}">
</xctk:PropertyGrid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
public class Company
{
public string Task { get; set; }
public string HeadNote { get; set; }
}
public class ViewModel
{
public PropertyDefinitionCollection PropertyDefinitionCollection { get; set; } =
new PropertyDefinitionCollection()
{
new PropertyDefinition()
{
TargetProperties = new[] { "Task" }
},
new PropertyDefinition()
{
TargetProperties = new[] { "HeadNote" }
}
};
public List<Company> ManufacturerList { get; set; }
public ViewModel()
{
List<Company> list = new List<Company>();
list.Add(new Company()
{
Task = "Coding",
HeadNote = "Coding Task",
});
list.Add(new Company()
{
Task = "Communicate",
HeadNote = "Communicate Task",
});
ManufacturerList = list;
}
}
- Dominant language
- C#
- Stars
- 4.2k
- Forks
- 912
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from xceedsoftware/wpftoolkit
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
xceedsoftware/wpftoolkit#1808 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
xceedsoftware/wpftoolkit#1807 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
xceedsoftware/wpftoolkit#1806 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 45/100
xceedsoftware/wpftoolkit#1804 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
xceedsoftware/wpftoolkit#1802 · 3 comments ·
All issues in xceedsoftware/wpftoolkit
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·