I am working with Entity Framework 4 and currently have a model consisting of many parent child tables. In the current scenario I am using a parent table called Lookups and a child table called LookupValues.
My Grid assignment statement is like:
grid.Datasource = entities.Lookup;
This is showing me the Lookups and LookupValues in the heirarchical format. I can even add/edit rows to Lookup band and I can also EDIT rows to the LookupValues (child) band.
However I am getting an error the moment I am clicking on the new row for the child band - "Underlying datasource doesn't support adding new rows".
Apart from the datasource assignment code as mentioned above, the only other code I have written is:
void ctlGrid_AfterRowUpdate(object sender, RowEventArgs e)
{
OtEntities.SaveChanges();
}
I don't think this is a coding error and rather a glitch with the WinGrid itself. Or may be there are some other properties I need to set which I am missing.
EBS.EntityBase.DAL.FM.tbl_Budget_Set objtbl_Budget_Set; objtbl_Budget_Set = new EntityBase.DAL.FM.tbl_Budget_Set(); this.grdtbl_Budget_Set_Detail.DataSource = new BindingList((objtbl_Budget_Set.tbl_Budget_Set_Group).ToList()); I was tried to do with the above code. But the problem is not solve
I am working with entity model (Dot Net 4) as datasource. For Infragistics.Win.UltraWinGrid.UltraGrid I use a Master table and the table has 1 child table and that child table has also another child table. I can see the existing data in the grid. Master data (Band[0]) can enter in the grid but when I tried to enter new row in child table then the error “Unable to add a new row. Underlying dataSource does not support adding new rows” showe.
Please, Someone help to come out from this issue.
Hi,
I just wanted to know if you were able to solve your issue based on Mike's suggestions or you still need help? Just let me know.
Thank you.
This is a limitation of your data source. This error message basically means that the DataSource you are using is returning an IList and not an IBindingList and therefore the grid and the DotNet BindingManager cannot determine how to create new rows.