GridViewDesigner.PreFilterProperties(IDictionary) Metod

Definition

Används av designern för att ta bort egenskaper från eller lägga till ytterligare egenskaper i visningen i rutnätet Egenskaper eller skuggegenskaper för den associerade kontrollen.

protected:
 override void PreFilterProperties(System::Collections::IDictionary ^ properties);
protected override void PreFilterProperties(System.Collections.IDictionary properties);
override this.PreFilterProperties : System.Collections.IDictionary -> unit
Protected Overrides Sub PreFilterProperties (properties As IDictionary)

Parametrar

properties
IDictionary

En samling som implementerar de IDictionary tillagda och skuggade egenskaperna.

Exempel

I följande kodexempel visas hur du åsidosätter PreFilterProperties metoden i en klass som ärvs från GridViewDesigner för att ändra rutnätet Egenskaper för GridView kontrollen vid designtillfället. Exemplet gör egenskapen Page synlig i rutnätet Egenskaper .

// Shadow the control properties with design-time properties.
protected override void PreFilterProperties(IDictionary properties)
{
    // Call the base method first.
    base.PreFilterProperties(properties);

    // Make the Page visible in the Properties grid.
    PropertyDescriptor selectProp = 
        (PropertyDescriptor)properties["Page"];
    properties["Page"] =
        TypeDescriptor.CreateProperty(selectProp.ComponentType, 
            selectProp, BrowsableAttribute.Yes);
} // PreFilterProperties
' Shadow the control properties with design-time properties.
Protected Overrides Sub PreFilterProperties( _
    ByVal properties As IDictionary)

    ' Call the base method first.
    MyBase.PreFilterProperties(properties)

    ' Make the Page visible in the Properties grid.
    Dim selectProp As PropertyDescriptor = _
        CType(properties("Page"), PropertyDescriptor)
    properties("Page") = _
        TypeDescriptor.CreateProperty(selectProp.ComponentType, _
            selectProp, BrowsableAttribute.Yes)
End Sub

Kommentarer

Kontrolldesigners använder metoder som härleds från ComponentDesigner.PreFilterProperties metoden för att skugga olika kontrollegenskaper med motsvarande designtidsegenskaper som designern implementerar och för att lägga till egenskaper i eller ta bort egenskaper från rutnätet Egenskaper .

GridView För kontrollen PreFilterProperties anger BrowsableAttribute metoden objektet Columns för egenskapen till false när kontrollen är i mallläge. Det här är så att en kolumn som är i mallläge inte kan tas bort med hjälp av dialogrutan Fält .

Anteckningar till arvingar

Åsidosätt PreFilterProperties(IDictionary) metoden för att lägga till egenskaper i eller ändra attribut för egenskaper i egenskapssamlingen design-time. Var noga med att anropa basmetoden innan du utför annan bearbetning.

Gäller för

Se även