How do I set the default, initial view for a PropertyGrid to display categorized/grouped instead of listed Alphabetically?
This was answered for WPF
http://www.telerik.com/community/forums/wpf/property-grid/default-view-in-propertygrid.aspx
How would you do this in the Silverlight Version of the PropertyGrid
Thanks
10 Answers, 1 is accepted
The exact same approach is applicable for Silverlight as well. Still, we will try to implement setting the grid in a grouped state as a built-in feature. Unfortunately, no time frame may be defined when this functionality will be included.
Let me know in case you need any further assistance.
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
I implemented the WPF fix in Silverlight and it fails to find any RadRadioButtons in this line of code:
var button =
this
.PersonDetailPropertyGrid.ChildrenOfType<RadRadioButton>().Where(b => b.Name ==
"groupButton"
).First();
Has anyone had this working?
Thanks D.
I have tested the case, but still it works correctly on my side. I am attaching the sample I use for the case. Please take a look at it and let me know in case of any misunderstandings.
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
Thanks for the quick reply. I'm trying to do this in Silverlight, the PropertyGrid is inside a RadOutlookBar but I wouldn't expect that to make any difference. The attached image shows my code and the error I get.
Thanks. D.
Please excuse me for the misunderstanding. I have prepared an example targeting Silverlight, but sill I am not able to get the same exception. I am attaching the application. May you take a look at it and let me know whether I need to add something so that to be capable of reproducing the case ?
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
I've tested your example app and it did indeed work, however when I place the PropertyGrid inside a RadOutlookItem which is inside a RadOutlookBar I get the error I reported.
Regards
Derek
You can try to perform the exact same logic in the Loaded event of the property grid:
private void myPropertyGrid_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
var button = this.myPropertyGrid.ChildrenOfType<
RadRadioButton
>().Where(b => b.Name == "groupButton").FirstOrDefault();
button.IsChecked = true;
}
I am sending you the updated project so that you may test the functionality.
Greetings,
Maya
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
That worked, thanks for your help. One more small question; is there a way to change the order of the grouping? It's alphabetical by default which isn't ideal for my UI.
Derek
Unfortunately, such functionality is not supported by RadPropertyGrid.
Still, let me know in case you need any further assistance.
Maya
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
i have some problems with RadpropertyGrid, i.e
default the TextBoxes in the radpropertygrid are editable mode, according to my requirements default am changing the EditorTemplate(Like Texbox isEnabled=false ,so the texboxes in the radpropertygrid are readonly mode), and when i click my own button am changing the EditorTemplate to editable mode(i.eTexbox isEnabled=true, we can enter text here in the texbox),
problems are
1)when i enter text in to search box of RadPropertyGrid ...>the search results shows default one i.e texbox isEnabled=false(if am in editable mode i.e Texbox isEnabled=true)
2)when i try to click groupButton and sortButton the result templates are different. present am in groupButton and texboxes are Editable mode, if am click sort button the texboxes are mode of radpropertygrid loaded time(either readonly are editable)
3) presentely am in group mode---->if am try to bind the data(any event changes) ..it does't shows the data in group mode(but data is there), if am click the sort button and back to groupbutton it shows the data.why it does't shows the data in group mode if am binding data?
see the below attached images in each case