Hi there,
I've a propertygrid control linked to a XtraGridView.
At runtime all gridview properties are displayed, but I've some issues when trying to access these properties via code using a custom class.
C#public class SetVisibleRowOperation : DevExpress.XtraVerticalGrid.Rows.RowOperation
{
public List AllowedProperties { get; set; }
public override void Execute(DevExpress.XtraVerticalGrid.Rows.BaseRow row)
{
Console.WriteLine(row.Properties.Caption);
row.Visible = AllowedProperties.Contains(row.Properties.Caption);
}
}
I'd like to hide all properties except these:
C#private void checkPropertyGridRowsVisibility()
{
var visibleOperation = new SetVisibleRowOperation()
{
AllowedProperties = new List { "Options", "OptionsBehavior", "OptionsFind", "OptionsView", "AllowFixedGroups",
"AllowPartialGroups", "AutoExpandAllGroups", "AllowFindPanel", "AlwaysVisible", "ShowFooter", "ShowGroupPanel", "ShowIndicator" }
};
propertyGridControl.RowsIterator.DoOperation(visibleOperation);
}
But it seems all properties under OptionsView and similar (3rd level) are not accessed by the iterator ¿?
In the Execute method I can see (when debugging OptionsView property) that row.HasChildren value is TRUE but row.HasChildRows has no items inside ¿?
Plus, there is a Rows property (only visible in the Quickwatch debug window) that is showing the correct items…
Maybe I'm missing something?
The only thing I need is hide all properties that are not in list…
L