This is a migrated thread and some comments may be shown as answers.

Order the categories In PropertyGrid as per requirement

5 Answers 266 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Dharmavaram
Top achievements
Rank 1
Dharmavaram asked on 26 Sep 2016, 11:32 AM

Hi, 

   I need to order the Categories in the PropertyGrid.Is there any way to achieve it? In the given picture I want to have the group order as

 1.  Personal

2.Personal Contact

3.Name

4.WorkContact

5.JobDescription

 

Regards,

Nagasree.

 

 

5 Answers, 1 is accepted

Sort by
0
Stefan Nenchev
Telerik team
answered on 29 Sep 2016, 08:17 AM
Hi Dharmavaram,

You can work with the OrderIndex property of the PropertyDefinitions. In case you are autogenerating the property definitions, you can use the AutogeneratingPropertyDefinition event to set a certain order index. If you have custom property definitions, you can directly set the order index as below:

<telerik:RadPropertyGrid Item="{Binding Clubs[0]}"
           AutoGeneratePropertyDefinitions="False">
          <telerik:RadPropertyGrid.PropertyDefinitions>
              <telerik:PropertyDefinition DisplayName="Name" Binding="{Binding Name}" OrderIndex="1"/>
              <telerik:PropertyDefinition DisplayName="Established" Binding="{Binding Established}"  OrderIndex="2"/>
              <telerik:PropertyDefinition DisplayName="StadiumCapacity" Binding="{Binding StadiumCapacity}"  OrderIndex="3"/>
          </telerik:RadPropertyGrid.PropertyDefinitions>
      </telerik:RadPropertyGrid>


Regards,
Stefan Nenchev
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Dharmavaram
Top achievements
Rank 1
answered on 29 Sep 2016, 10:44 AM

Hi Stefan,

  I have to order the grouped categories not individual properties.I am able to order individual properties using order attribute.

Regards,

Nagasree.

0
Stefan Nenchev
Telerik team
answered on 29 Sep 2016, 12:33 PM
Hi Nagasree,

Excuse me for the misunderstanding. You can`t directly set the Order of the Groups but they will respect the order of the PropertyDefinitions within them. Please check the attached example where I have modified the demo you are referring to so that the desired behavior is achieved. 

Regards,
Stefan Nenchev
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Dharmavaram
Top achievements
Rank 1
answered on 30 Sep 2016, 04:19 AM

Hi stefan,

 I am not able to run the attached project.

Regards,

Nagasree

0
Stefan Nenchev
Telerik team
answered on 30 Sep 2016, 02:30 PM
Hi Nagasree,

Please, try with the updated sample. Actually, I have copied the files from the "GroupStyleSelector support" demo from our WPF application and just modified the Employee class. With this in mind, if you still have any issues with the new project, you can simply recreate it and check the class from the solution I have provided. 

Regards,
Stefan Nenchev
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
PropertyGrid
Asked by
Dharmavaram
Top achievements
Rank 1
Answers by
Stefan Nenchev
Telerik team
Dharmavaram
Top achievements
Rank 1
Share this question
or