Order the categories In PropertyGrid as per requirement

6 posts, 0 answers
  1. Dharmavaram
    Dharmavaram avatar
    73 posts
    Member since:
    Jun 2013

    Posted 26 Sep Link to this post

    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.

     

     

  2. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    281 posts

    Posted 29 Sep Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Dharmavaram
    Dharmavaram avatar
    73 posts
    Member since:
    Jun 2013

    Posted 29 Sep in reply to Stefan Nenchev Link to this post

    Hi Stefan,

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

    Regards,

    Nagasree.

  5. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    281 posts

    Posted 29 Sep Link to this post

    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.
  6. Dharmavaram
    Dharmavaram avatar
    73 posts
    Member since:
    Jun 2013

    Posted 29 Sep in reply to Stefan Nenchev Link to this post

    Hi stefan,

     I am not able to run the attached project.

    Regards,

    Nagasree

  7. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    281 posts

    Posted 30 Sep Link to this post

    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.
Back to Top
UI for WPF is Visual Studio 2017 Ready