how to show editor as complete row in the property grid

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

    Posted 13 Sep Link to this post

    Hi,

    I want to show my user control Editor  as complete row in the property grid without display name column in the row. In the attached image I have shown what I am getting now. I want to show only Color editor once we open color group with out showing again color as display name in the row.How to achieve it?? 

     

  2. Stefan X1
    Admin
    Stefan X1 avatar
    523 posts

    Posted 14 Sep Link to this post

    Hi Dharmavaram,

    Such customization would require the template of PropertyGridField to be modified. You may find the Editing Control Templates and the Implicit Styles topics useful on this matter.

    So, within the Control Template of the aforementioned element there is a Grid with x:Name="PART_PropertyGridFieldGridN". It has 3 columns, respectively for the PropertyGridPresenter, the Label and the editor of each row. You can simply set the second column's(for the Label) Width to be zero and the visual appearance of the control should be as per your requirement.

    Can you please give the approach a try and let me know how it goes?

    Regards,
    Stefan X1
    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 14 Sep in reply to Stefan X1 Link to this post

    Hi Stefan,

       I will try and let you know.But I don't want that style for all the rows only specific groups I want to apply such style.Is it Possible?

  5. Stefan X1
    Admin
    Stefan X1 avatar
    523 posts

    Posted 16 Sep Link to this post

    Hello Dharmavaram,

    A possible solution for this requirement is to use the FieldLoaded event of RadPropertyGrid. Through the event arguments of the event you should be able to apply the needed template only for a given PropertyDefinition. Please take a look at the snippet below.
    private void propertyGrid_FieldLoaded(object sender,
        FieldEventArgs e)
    {
        if ((e.Field.DataContext as PropertyDefinition)
            .DisplayName == "Count")
        {
            //apply the predefined template through the Style property of the Field
        }
    }

    I hope this helps. In case you need further assistance, feel free to update me.

    All the best,
    Stefan X1
    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 19 Sep in reply to Stefan X1 Link to this post

    Hi Stefan,

        This won't help my requirement.I want one column in that row where I am going to show completely filed editor only without column display name.

    Regards,

    Nagasree.

     

     

     

  7. Stefan X1
    Admin
    Stefan X1 avatar
    523 posts

    Posted 20 Sep Link to this post

    Hi Dharmavaram,

    In case I am not missing anything, the suggested approach would fit your exact requirement. Once you have the modified template of the PropertyGridField, you should be able to apply it explicitly to the Field of a particular PropertyDefinition. This can be achieved by defining the predefined ControlTemplate as a Resource and apply it as demonstrated in the How to: Retrieve Resources in Code article.

    I hope this clarifies your concerns.

    Regards,
    Stefan X1
    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