Async request failed [InvalidOperationException]: Collection was modified; enumeration operation may not execute.
on trying to sort a child grid using manual on demand. how can i fix this?
I know this is an old post, but this is what helped me:
http://codecorner.galanter.net/2013/04/29/solution-for-webhierarchicaldatagrids-async-request-failed-error/
Hello dev_here,
If you have any further questions, please feel free to contact me.
Hi dev_here,
Please check this thread regarding the matter and refer to the attached samples in it - http://es.infragistics.com/community/forums/t/64707.aspx.
Please let me know if this helps.
Nikolay,
here is what's happening. We are trying to use version less dlls as we have a lot of ultrawebgrids on our site and as of now we are taking only one of these to see how it performs before we move over to 11.2 version where ultrawebgrid is no longer supported. As soon as i try to page on the child grid i see that it hits the RowIslandPopulating (which it shouldnt) and then gives this error.We are getting the parent and the child from datsets and trying to do manual load on demand. here is a sample snippet. Please let me know if there is anything different I should do. Or rather a working sample of any childbehaviours enabled for datsets with manual LOD would be helpful.
protected void myGrid_RowIslandsPopulating(object sender, Infragistics.Web.UI.GridControls.ContainerRowCancelEventArgs e)
{
//Cancel the default automatic load on demand operation
e.Cancel = true;
BindSecondLevel(e);
}
private void BindSecondLevel(Infragistics.Web.UI.GridControls.ContainerRowCancelEventArgs e)
DataSet ds = new DataSet();
int myId = Int32.Parse(e.Row.Items.FindItemByKey("IdColumn").Value.ToString());
ds = GeDataTableByChild(myId);
// Create Container Grid
ContainerGrid childGrid = new ContainerGrid();
BoundDataField myAddress = new BoundDataField();
myAddress .DataFieldName ="Address";
myAddress.Key ="AddressColumn";
myAddress.Header.Text ="Address";
BoundDataField name = new BoundDataField();
name.DataFieldName ="Name";
name.Key ="NameColumn";
name.Header.Text ="Name";
childGrid.Columns.Add(name);
childGrid.Columns.Add(myAddress);
childGrid.DataMember = "Child";
childGrid.Level = 1; childGrid.DataKeyFields = "MyAddress";
childGrid.DataSource = ds;
childGrid.Behaviors.CreateBehavior<Infragistics.Web.UI.GridControls.Paging>();
childGrid.Behaviors.Paging.Enabled = true;
childGrid.Behaviors.Paging.PagerMode = Infragistics.Web.UI.GridControls.PagerMode.Numeric;
childGrid.Behaviors.Paging.PageSize = 10; // childGrid.DataBind();
I tested you scenario but I could not reproduce the issue. In order to be able to investigate this further I would need a small isolated sample, replicating the described behavior.
If you have any other questions, please feel free to contact me.