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

Binding RadGrid to Data from Session

0 Answers 94 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
InfySam asked on 06 Jun 2012, 10:13 PM

I am putting DataSource of RadGrid into a Session and when I've to re-bind the RadGrid I want to use the Session. I tried by using the following code.

Binding the RdaGrid for the first time,

  var mentors = (dynamicModuleManager.GetDataItems(mentorType)).Where(i => i.Visible == true &&
                i.Status == ContentLifecycleStatus.Live &&
                (i.GetValue<IList<Guid>>("mentorshipcategories").Any(j => CategoriesChecked.Contains(j)) ||
                i.GetValue<IList<Guid>>("industries").Any(j => CategoriesChecked.Contains(j)) ||
                i.GetValue<IList<Guid>>("businessstages").Any(j => CategoriesChecked.Contains(j))));

            MentorDetailsGrid.DataSource = mentors;
            Session["TempMentorsResult"] = mentors;

So ultimately mentors variable is of type IQueryable<DynamicContent>.

Now while rebinding the RadGrid, here are the lines used,

 MentorDetailsGrid.DataSource= Session["TempMentorsResult"];
                MentorDetailsGrid.DataBind(); //At this point I am getting the run-time error  

The ObjectScope has already been disposed and it's managed persistent objects can no longer be accessed. The ObjectScope should be disposed at the end of the life cycle of your business logic instance. This can also be done in the Dispose of your ASP page or MVC controller.
Object name: 'OpenAccessRuntime.EnlistableObjectScope'.

Can someone please tell me where I am doing wrong?


No answers yet. Maybe you can help?

General Discussions
Asked by
Top achievements
Rank 1
Share this question