Dynamic cells

4 posts, 0 answers
  1. nagir
    nagir avatar
    161 posts
    Member since:
    Feb 2007

    Posted 10 May 2009 Link to this post

    Hi,

    I have a requirement to show dynamic grid. Under dynamic it's meant that following model should be displayed in the grid:
    Row-1---*-Cell

    Eg: there are objects Row and Cell with following information:
    1. Row can have zero or many cells of different types.
    2. Row can have zero or one cell of the same type.
    3. Cell can be in one and only one row.
    4. Number of cells in different rows might be different.

    I need show this table structure on the grid with following in mind:
    1. Each row on the grid represents a Row object
    2. Each Cell on the grid represents a cell of the particular row.
    3. Each column of the grid shows cells of the same type.

    Can you suggest me the best way of implementing it with RadGrid?

    Dynamically creating GridColumns I have no way to tell what should be rendered in a grid cell.
    I probably need to implement custom GridColumn but not sure what I have to override and where a value comes from.

    Thanks,
    Dmitriy.
  2. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 14 May 2009 Link to this post

    Hi nagir,

    One possible option in this case would be to use template columns, and dynamically toggle on/off their visibility, thus meeting the requirement to have different number of cells on each row. This also gives you a great degree of flexibility with respect to the controls nested inside.

    Greetings,
    Yavor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. nagir
    nagir avatar
    161 posts
    Member since:
    Feb 2007

    Posted 14 May 2009 Link to this post

    Yavor,

    The Row--Cell model is NOT static as Cell type is not (there might be a lot of them and we cannot know it at design time).
    So showing hiding of existing columns (it doesn't matter if it's a template column or a BoundColumn ) just cannot be used.

    Anything else?

    Only one solution I see is to convert all the model into flat Data Table and bind it to the grid autogenerating columns.
  5. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 18 May 2009 Link to this post

    Hello nagir,

    The rows in the grid must have consistent and identical structure. You can, at a later moment, hide some of the elements, and alter the span of the neighboring elements, however the structure must remain constant and identical, rather than having each row be of a different type.

    Sincerely yours,
    Yavor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top