14 Answers, 1 is accepted
Thanks.
Thank you for writing.
Each item has Visible property which can be used to show or hide the item at run time:
private
void
radButton1_Click(
object
sender, EventArgs e)
{
radPropertyGrid1.Items[
"Text"
].Visible =
false
;
}
Please let me know if there is something else I can help you with.
Dimitar
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Thank you for writing.
In order to remove items in RadPropertyGrid, you can use the RadPropertyStore.Remove and RadPropertyStore.RemoveAt methods. However, this approach requires populating your data in a RadPropertyStore. If you use a custom object, note that RadPropertyGrid extracts all of its properties and in order to remove a certain property you need to hide it as my colleague Dimitar suggested.
I hope this information helps. Should you have further questions, I would be glad to help.
Dess
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
i have Fx modifier and Media File. I can access teh L1 and remove it
fine. But there is no way to access the Fx modifier and Media File from
the propertystore. The only one i can access them is through the Item
list of PropertyGrid which is fine. But it is read only and i cannot
remove them.
Thank you for writing back.
You cannot edit the Items collection directly, it is populated depending on the selected object properties and represents a list of these properties, and since you cannot change the object properties count at runtime you should not be able to change the collection as well. Nevertheless you can easily show or hide the underlying properties of each item. You can access them by using the GridItems property:
private
void
radButton1_Click(
object
sender, EventArgs e)
{
radPropertyGrid1.Items[1].GridItems[2].Visible =
false
;
}
Another solution would be to use the Browsable attribute directly in your custom objects.
I hope this will be useful.
Regards,
Dimitar
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Hi
Can I know how to add element in the property grid
The following article shows how you can add items: RadPropertyStore - adding custom properties.
I hope this will be useful. Let me know if you have additional questions.
Regards,
Dimitar
Telerik by Progress
Hello Dimitar,
I have already few properties in RadPropertyGrid maybe they are stored from database table so if I am supposed to add new property then is it necessary to add it in database table because I have added property as shown in link and it is not showing up in GridView. So please help me.
These are two different approaches. If you are setting the SelctedObejct property to your custom business object you should add the property to this object. The property store gives you the ability to add properties manually, however, all properties must be added to the PropertyStore object and you should use the PropertyStore object as SelectedObject.
I hope this helps.
Regards,
Dimitar
Telerik by Progress
Hello Dimitar,
Can I know how to set property values. Suppose there is Color property so how to assign values to it so that when I change its values, its behavior should change accordingly. Like if I change color of series from blue to red how actually color of series is changing.
Thanks and Regards,
Suraj
The BackColor property in the series is a dependency property which will trigger layout update:
What is your specific case? What do you need to update in this case? Generally, your business object must implement the INotifyPropertyChanged interface.
I hope this information is useful. Let me know if you need further assistance.
Regards,
Dimitar
Telerik by Progress