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

Styling custom grid cell elements in OpenEdge

2 Answers 78 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 05 Apr 2016, 11:06 AM

I'm trying to implement a sample like this here

http://docs.telerik.com/devtools/winforms/gridview/cells/creating-custom-cells

In Progress OpenEdge. Unfortunately the ABL does not support overriding of properties, so I cannot achieve this here:

 

 protected override Type ThemeEffectiveType

{

    get { return typeof(GridDataCellElement);}

}

 

Is there any other way of inheriting the style from the base element type?

2 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 05 Apr 2016, 12:45 PM
Hello Mike,

Thank you for writing.

The ThemeEffectiveType property is read a number of times while your application is being initialized by an ItemStateManager object responsible for setting its initial state. Since in ABL you are not able to override the property you can still achieve your task by overriding the InitializeFields method of you custom class and by setting its ThemeRole property to equal the name of your base class. 

I understand that you are following the example here, so the custom class can look like this: 
public class ProgressBarCellElement : GridDataCellElement
{
    public ProgressBarCellElement(GridViewColumn column, GridRowElement row)
        : base(column, row)
    {
         
    }
 
    protected override void InitializeFields()
    {
        base.InitializeFields();
 
        this.ThemeRole = "GridDataCellElement";
    }
 
    //....
}

I hope this helps. Please let me know if you need further assistance.

Regards,
Hristo Merdjanov
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Mike
Top achievements
Rank 1
answered on 05 Apr 2016, 01:14 PM
Works like a charm! Thanks!!!
Tags
GridView
Asked by
Mike
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Mike
Top achievements
Rank 1
Share this question
or