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

how to show editor as complete row in the property grid

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

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?? 

 

5 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 14 Sep 2016, 11:19 AM
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.
0
Dharmavaram
Top achievements
Rank 1
answered on 14 Sep 2016, 11:26 AM

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?

0
Stefan
Telerik team
answered on 16 Sep 2016, 12:22 PM
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.
0
Dharmavaram
Top achievements
Rank 1
answered on 19 Sep 2016, 11:06 AM

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.

 

 

 

0
Stefan
Telerik team
answered on 20 Sep 2016, 02:27 PM
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.
Tags
PropertyGrid
Asked by
Dharmavaram
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Dharmavaram
Top achievements
Rank 1
Share this question
or