I am trying to implement drag and drop functionality for a single RadGrid. My RadGrid is bound as follows:
Data is retrieved from Microsoft Dynamics CRM and displayed in the grid correctly. Now, I am trying to implement the server-side onRowDrop event handler. The line below is giving me an "Index was out of range. Must be non-negative and less than the size of the collection" error. Could this be due to the way that I have bound the RadGrid? Please help.
| private void RetrieveData() |
| { |
| ////first retrieve projects |
| List<UIProject> projects = RetrieveProjects(); |
| projects.ForEach(a => |
| { |
| a.Features = (from u in Helper.DataContextFromWeb.MagUserstories |
| where u.MagProjectId == a.ProjectId && u.Statuscode == 1 |
| orderby u.MagTitle |
| select new UIFeature |
| { |
| FeatureId = u.MagUserstoryId, |
| FeatureName = u.MagTitle |
| }).ToList(); |
| a.Features.ForEach(b => |
| { |
| b.Tasks = (from t in Helper.DataContextFromWeb.MagTasks |
| where t.MagUserStoryId == b.FeatureId && t.Statuscode == 1 |
| orderby t.MagTitle |
| select new UITask |
| { |
| TaskName = t.MagTitle, |
| ActualHours = t.MagActualTime, |
| EstimatedHours = t.MagEstimatedTime, |
| //Status = |
| //Owner = |
| }).ToList(); |
| }); |
| }); |
| BindMasterBackLog(projects); |
| } |
| private void BindMasterBackLog(List<UIProject> projects) |
| { |
| this.masterbacklog.DataSource = projects; |
| this.masterbacklog.DataMember = MagProject.Fields.MagProjectId; |
| this.masterbacklog.DataBind(); |
| } |
| UIProject project = RetrieveProject(projects, (Guid)e.DestDataItem.GetDataKeyValue("ProjectId")); |
