MobileForms Toolkit Documentation

Cell.CurrentRow Property

Gets During drawing contains the reference to current row.

protected Row CurrentRow {get;}

Example

The following sample demonstrates the usage in the derived cell (C# only, see also example in AddColumns method of Mapping):

[C#]

class ColorTextCell : Resco.Controls.TextCell
{
    public ColorTextCell(Resco.Controls.TextCell c) : base(c)
    {
    }
    
    // The BackColor and ForeColor of this TextCell are bound
    // to the respective columns in currently drawn row,
    // thus allowing us to change it for every row separately.

    public override Color BackColor
    {
        get
        {
            // take the color from current data, they are set when 
            // drawing the row
            object backColor = CurrentRow["BackColor"];
            if (backColor is Color)            
                return (Color) backColor;
            
            // if using the BoundRow and DataTable, you have to convert
            // it to/from string
            
            return Color.Transparent;
        }
    }
    public override Color ForeColor
    {
        get
        {
            // take the color from current data, they are set when 
            // drawing the row
            object foreColor = CurrentRow["ForeColor"];
            if (foreColor is Color)
                return (Color) foreColor;
            return Color.Transparent;
        }
    }
}
            

See Also

Cell Class | Resco.Controls.AdvancedList Namespace