Skip to main content

Variable Columns

Comments

1 comment

  • Dapfor Team

    Dear Deepak,

     

    The grid doesn’t display business data directly. When you add a business object to the grid, it wraps implicitly this object with corresponding implementation of the IDataAccessor interface.

    Dapfor.Net framework provides many implementations of this interface (DataObjectAccessor for objects of custom classes, ListDataAccessor for objects implementing IList interface, DictionaryDataAccessor for objects, implementing IDictionary). That’s why you can use the grid as follows:

    grid.Rows.Add(new MyCalss()) or 
    grid.Rows.Add(new string[]{‘toto’, ‘titi’})

    You can also write your own data accessor but in your case the best way is to use the UnboundValueAccessor instead of MatrixModel:

    Row row = grid.Rows.Add(new UnboundValueAccessor());
    row["GEM4"].Value = 10;
    row["toto"].Value = "titi";

     

    Best regards,

    Dapfor

     

    0

Please sign in to leave a comment.

Powered by Zendesk