I am trying to bind an Infragistics Hierichael Web Grid and keep getting the above error message. When I debug the code, I definately have data in the datasource. I am not sure where to go from here because everything looks right. Any help is greatly appreciated.Here is my code:
protected void Page_Load(object sender, EventArgs e)
{
string physicianNPI;
decimal mphysicianNPI;
physicianNPI = Session.Contents["physicianNPI"].ToString();
mphysicianNPI = Convert.ToInt32(physicianNPI); var InboxResult = from patientdata in dc.Patients
join referrals in dc.Referrals on patientdata.MPI equals referrals.MPI orderby patientdata.Lname
orderby patientdata.Fname select new
{referrals.RefDate,
patientdata.MPI,
patientdata.Fname,
patientdata.Lname,
patientdata.DOB,
referrals.RefReason, };
WebHierarchicalDataGrid1.DataSource = InboxResult;
WebHierarchicalDataGrid1.DataBind(); < ----------------- Error Occures Here }
Found the answer. You must use a Hierachical Data Source when assigning a data source to this type of grid. I did it throught the control itself and it worked fine. No progamming was necessary.