Completed
Last Updated: 09 Sep 2015 11:38 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 09 Feb 2015 11:15
Category: GridView
Type: Bug Report
0
FIX. RadGridView - custom columns added by using the PropertyBuilder are not serialized.
To reproduce:

public class ProgressBarCellElement : GridDataCellElement
{ 
          
    public ProgressBarCellElement(GridViewColumn column, GridRowElement row) : base(column, row)
    {
    }

    private RadProgressBarElement radProgressBarElement;

    protected override void CreateChildElements()
    {
        base.CreateChildElements();

        radProgressBarElement = new RadProgressBarElement();
        this.Children.Add(radProgressBarElement);
    }

    protected override void SetContentCore(object value)
    {
        if (this.Value != null && this.Value != DBNull.Value)
        {
            this.radProgressBarElement.Value1 = Convert.ToInt16(this.Value);
        }
    }

    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(GridDataCellElement);
        }
    }

    public override bool IsCompatible(GridViewColumn data, object context)
    {
        return data is ProgressBarColumn && context is GridDataRowElement;
    }
}

public class ProgressBarColumn : GridViewDataColumn
{
    public ProgressBarColumn() : base()
    {
    }

    public ProgressBarColumn(string fieldName) : base(fieldName)
    {
    }

    public override Type GetCellType(GridViewRowInfo row)
    {
        if (row is GridViewDataRowInfo)
        {
            return typeof(ProgressBarCellElement);
        }
        return base.GetCellType(row);
    }
}
0 comments