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

[Solved] how to bind to a viewbag

2 Answers 165 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
georges
Top achievements
Rank 1
georges asked on 09 Feb 2011, 12:24 AM
i am trying to bind to a grid to a view bag. i got the data back in

ViewBag.SelectNewDataProject.PROJECT_EXT and thats a list.

 

<

 

 

 

div id="AllProjectGrid" class="ApplicationFontInBlack">

 

 

 

 

 

 

 

@(

Html.Telerik().Grid(Model)

.Name(

 

 

"Grid")

 

.BindTo(ViewBag.SelectNewDataProject.PROJECT_EXT)

 

.Groupable()

.Sortable()

.Pageable()

.Filterable()

)

 

 

 

</div>

 

 



any ideas? thanks

2 Answers, 1 is accepted

Sort by
0
Tako
Top achievements
Rank 2
answered on 10 Mar 2011, 09:40 AM
Some sample code here would be highly appreciated on how one would be able to connect to a viewbag. Have been trying to connect to a viewbag which definetly contains data but keep receiving...

'An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll'

No idea why!
0
James
Top achievements
Rank 1
answered on 04 Nov 2011, 06:22 PM
I think this has to do with the fact that the grid cannot determine the columns to bind to.  I was having similar issues binding a grid to a "dynamic" type, and it was throwing this exception.  However, I also remembered that I was able to get a grid to bind to a "dynamic" type, as long as I provided column definition information so that the grid could properly determine the columns to display and the properties to bind to.  I hope this information helps.
Tags
Grid
Asked by
georges
Top achievements
Rank 1
Answers by
Tako
Top achievements
Rank 2
James
Top achievements
Rank 1
Share this question
or