Skip to main content

How customize the parameters for the property with the attribute [CompositeField]

Comments

1 comment

  • Dapfor Team

    Hello,

    You can do it in the grid.PaintCell routine:

    grid.PaintCell += delegate(object sender, PaintCellEventArgs e)
    {
        if(e.Cell.Column != null && e.Cell.Column.Id == "your column id")
        {
            switch (e.Cell.Row.ChildIndex) //You can also use e.Cell.Row.VisibleIndex
            {
                case 0:
                    e.Text = new DoubleFormat(4).Format(e.Cell.DataField);
                    break;

                case 1:
                    e.Text = new DoubleFormat(6).Format(e.Cell.DataField);
                    break;
                
                case 2:
                    e.Text = new DoubleFormat(1).Format(e.Cell.DataField);
                    break;
            }
        }
    };

     

    To prevent from often DoubleFormat object creation, you can create a pool of formats or use them as members of your control.

    Best regards,

    The Dapfor Team

    0

Please sign in to leave a comment.

Powered by Zendesk