Hi all,
I use GridView + DataPager with QueryableCollectionView , mainly do CURD operations, everything worked well but add new item.
Please note I assign IQueryable source to QueryableCollectionView for solving huge data performance issue. When I call gridVIew's BeginInsert(); , one new row will be shown in first row of GridView. That's fine, but there are some questions.
1. The insert row will disappear if I click another row(With setting ActionOnLostFocus = ActionOnLostFocus.None), I cannot find it in grid view any more. because I have added it to EF ObjectContext, so if I do this once and then SaveChanges() , the two entries will be inserted into database!
I have used AddingNewDataItem Event , but I still can not find the new item in QueryableCollectionView and GridView.Items
public void AddingNewDataItem(object sender, GridViewAddingNewEventArgs e)
{
var entity = copyItem ?? new TOrginal();
copyItem = null;
IntializeNewItem(entity);
var model = new TModel { Model = entity };
CurrentItem = model;
e.NewObject = model;
// AddModelToCollection(e, model);
if (CheckItemIsNew(CurrentItem)) return;
CommonManager.Add(entity);
}
next..I also try to insert Item into QueryableCollectionView directly, the gridview even do not show new item..
So I only can do delete it from EF context when CurrentItem change...
2. How to make Insert Row always visible when Adding new Row and Click other rows of this grid.???
Can you please give me some hint? It driven me crazy.
If you cannot solve this, can you please give me one solution for big data and CURD mechanism.
I use GridView + DataPager with QueryableCollectionView , mainly do CURD operations, everything worked well but add new item.
Please note I assign IQueryable source to QueryableCollectionView for solving huge data performance issue. When I call gridVIew's BeginInsert(); , one new row will be shown in first row of GridView. That's fine, but there are some questions.
1. The insert row will disappear if I click another row(With setting ActionOnLostFocus = ActionOnLostFocus.None), I cannot find it in grid view any more. because I have added it to EF ObjectContext, so if I do this once and then SaveChanges() , the two entries will be inserted into database!
I have used AddingNewDataItem Event , but I still can not find the new item in QueryableCollectionView and GridView.Items
public void AddingNewDataItem(object sender, GridViewAddingNewEventArgs e)
{
var entity = copyItem ?? new TOrginal();
copyItem = null;
IntializeNewItem(entity);
var model = new TModel { Model = entity };
CurrentItem = model;
e.NewObject = model;
// AddModelToCollection(e, model);
if (CheckItemIsNew(CurrentItem)) return;
CommonManager.Add(entity);
}
next..I also try to insert Item into QueryableCollectionView directly, the gridview even do not show new item..
So I only can do delete it from EF context when CurrentItem change...
2. How to make Insert Row always visible when Adding new Row and Click other rows of this grid.???
Can you please give me some hint? It driven me crazy.
If you cannot solve this, can you please give me one solution for big data and CURD mechanism.