Completed
Last Updated: 03 Jan 2017 14:54 by ADMIN
ADMIN
Dimitar
Created on: 23 Dec 2016 12:09
Category: PropertyGrid
Type: Bug Report
1
FIX. RadPropertyGrid - the layout is not updated when the item visibility is changed.
To reproduce:
public Form1()
{
    InitializeComponent();
    this.radPropertyGrid1.Size = new System.Drawing.Size(272, 135);
    PropertyStoreItem intItem = new PropertyStoreItem(typeof(int), "Integer", 1);
    PropertyStoreItem showTrend = new PropertyStoreItem(typeof(bool), "ShowTrend", 0);
    PropertyStoreItem trendItem1 = new PropertyStoreItem(typeof(int), "TrendTypes", 0);
    // Case of Re-loading the previously Saved Trend Type
    PropertyStoreItem floatItem = new PropertyStoreItem(typeof(float), "Float", 1f,
        "Property storing a floating point value.");
    PropertyStoreItem stringItem = new PropertyStoreItem(typeof(string), "String", "Telerik",
        "Property storing a string value", "Telerik");
    PropertyStoreItem dockItem = new PropertyStoreItem(typeof(DockStyle), "Dock", DockStyle.Top,
        "Property containing DockStyle value", "Layout", false);
    RadPropertyStore store = new RadPropertyStore();
    store.Add(intItem);
    store.Add(showTrend);
    store.Add(trendItem1);
    store.Add(floatItem);
    store.Add(stringItem);
    store.Add(dockItem);
    this.radPropertyGrid1.SelectedObject = store;
   radPropertyGrid1.Items["TrendTypes"].Visible = false;
    this.radPropertyGrid1.PropertyValueChanged += radPropertyGrid1_ValueChanged;

}

private void radPropertyGrid1_ValueChanged(object sender, PropertyGridItemValueChangedEventArgs e)
{

    PropertyGridItem current = (PropertyGridItem)e.Item;
    if (current.Name == "ShowTrend")
    {
        bool val = Convert.ToBoolean(current.Value);
        radPropertyGrid1.Items["TrendTypes"].Visible = val;
    }

}

- There is no scrollbar when the item is shown.

Workaround:
radPropertyGrid1.PropertyGridElement.PropertyTableElement.Update(PropertyGridTableElement.UpdateActions.ExpandedChanged);

(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments