I have a wpf application with PropertyGrid.
When I load PropertyGrid, I want to expand all the propertyitems by default.
In version 2.0, this behavior was there.
In version 2.4, all the property items are collapsed.
I tried expanding it through code, but its not working
```
public void ExpandPropertyGrid()
{
if (customerPropertyGrid.Properties == null)
return;
foreach (var property in customerPropertyGrid.Properties)
{
if ((property as PropertyItem).IsExpandable)
{
(property as PropertyItem).IsExpanded = true;
ExpandProperty((property as PropertyItem));
}
}
}
public void ExpandProperty(PropertyItem property)
{
if (property.Properties == null)
return;
foreach (var element in property.Properties)
{
(element as PropertyItem).IsExpanded = true;
ExpandProperty((element as PropertyItem));
}
}
}
```
Let me know how to expand all items.
Regards,
Sharda.
When I load PropertyGrid, I want to expand all the propertyitems by default.
In version 2.0, this behavior was there.
In version 2.4, all the property items are collapsed.
I tried expanding it through code, but its not working
```
public void ExpandPropertyGrid()
{
if (customerPropertyGrid.Properties == null)
return;
foreach (var property in customerPropertyGrid.Properties)
{
if ((property as PropertyItem).IsExpandable)
{
(property as PropertyItem).IsExpanded = true;
ExpandProperty((property as PropertyItem));
}
}
}
public void ExpandProperty(PropertyItem property)
{
if (property.Properties == null)
return;
foreach (var element in property.Properties)
{
(element as PropertyItem).IsExpanded = true;
ExpandProperty((element as PropertyItem));
}
}
}
```
Let me know how to expand all items.
Regards,
Sharda.