This is a migrated thread and some comments may be shown as answers.

[Solved] Dynamically created detail table columns disappear when expanding another row

2 Answers 80 Views
Grid
This is a migrated thread and some comments may be shown as answers.
DJ
Top achievements
Rank 1
DJ asked on 08 Jul 2013, 08:50 PM
Hello there,

I am binding the detail table to a dynamic object so I don't have any sense of what columns are going to appear so I have implemented this through dynamic columns on the grid's DetailTableDataBind method before I bind it to the datasource. This worked fine and all the columns are created accordingly but when I select/expand another row, all my dynamic columns (on the previously selected row) disappears. I have tried creating the columns on the ItemDataBound method as well but to no avail. Any thoughts?

Thanks,
DJ 

2 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 11 Jul 2013, 01:35 PM
Hello,

Based on the description you provided it would be hard to point you to the reason for the issue. Could you send a runnable project where the problem is observed? This would enable us to better understand the scenario you have and provide you with the best possible solution. You could open a formal support ticket and send the project as attachment or you could share the code in this thread as a code block.

I am looking forward to your reply.

Regards,
Viktor Tachev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
DJ
Top achievements
Rank 1
answered on 23 Jul 2013, 08:08 PM
I found the cause of the issue - the grid does not save the columns in the viewstate if there isn't any explicit column definitions for it. I fixed it by explicitly defining columns on the markup and just toggling the display property appropriately.
Tags
Grid
Asked by
DJ
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
DJ
Top achievements
Rank 1
Share this question
or