Auto-generate columns in DataForm

2 posts, 0 answers
  1. Terry
    Terry avatar
    5 posts
    Member since:
    Oct 2012

    Posted 16 Dec 2014 Link to this post

    Is it possible to auto-generate columns in a DataForm? In my application, I don't know which fields to bind until runtime. I not only need to be able to auto-generate fields but also loop through these fields and specify which of the fields is editable. I'd hate to resort to a DetailsView control to do this.
  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1795 posts

    Posted 19 Dec 2014 Link to this post

    Hello Terry,

    With the current implementation of RadDataForm, there is no functionality for auto-generating editors dynamically. The only supported scenario is by defining the LayoutTemplate, ItemTemplate, EditItemTemplate and InsertItemTemplate.

    If you have limited amount of options for the data source you can define those templates in the code-behind for each data source and create the RadDataForm programmatically with the corresponding to the data source templates. However, this will be a highly complex task and I could recommend it.

    You should consider using one of our controls that have auto-generate functionality - RadGrid or RadTreeList for example.


    Best Regards,
    Konstantin Dikov
    Telerik
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top