Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> Data record delete from XtraGrid (devexpress) but not delete from database table
 

Pages: 1
LLBLGen Pro Runtime Framework
Data record delete from XtraGrid (devexpress) but not delete from database table
Page:1/1 

  Print all messages in this thread  
Poster Message
nopchan
User



Location:

Joined on:
30-Apr-2005 02:19:03
Posted:
56 posts
# Posted on: 13-Sep-2005 04:14:09.  
I'm using XtraGrid (devexpress.com) with data adapter model
,when I select row then click [-] delete navigator (DevExpress.XtraEditors.NavigatorButton) data record delete from xtragrid but can not delete from entity collection when adapter.SaveEntityCollection

Quote:

adapter.StartTransaction(IsolationLevel.ReadCommitted, "Edit Data");
GrBankAccCollection = new EntityCollection(new BankaccEntityFactory());
RelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(PredicateFactory.CompareValue(BankaccFieldIndex.CompanyId, ComparisonOperator.Equal, SetCompanyID.ToString()));
GrBankAccCollection.AllowRemove = true;
adapter.FetchEntityCollection(GrBankAccCollection,bucket);
BankAccGrid.DataSource = GrBankAccCollection;
    


I select row then click delete navigator then data record delete from grid complete ,data is not display in grid when clieck delete but

Quote:
adapter.SaveEntityCollection(GrBankAccCollection);
adapter.Commit();
    


Data record is not delete from table of sql database. (sql2000)

when I move xxxx.AllowRemove = true; to after FetchEntityCollection
Data record is not delete from database table too.

Quote:
adapter.FetchEntityCollection(GrBankAccCollection,bucket);
GrBankAccCollection.AllowRemove = true;
BankAccGrid.DataSource = GrBankAccCollection;




  Top
nopchan
User



Location:

Joined on:
30-Apr-2005 02:19:03
Posted:
56 posts
# Posted on: 14-Sep-2005 05:23:49.  
I can work now.

with event add for XtraGrid

example

Quote:
this.BankGrid.EmbeddedNavigator.ButtonClick += new NavigatorButtonClickEventHandler(buttonClick);


Quote:
private void buttonClick(object sender, DevExpress.XtraEditors.NavigatorButtonClickEventArgs e)
{
string SelectBankId ;
if(e.Button.ButtonType == DevExpress.XtraEditors.NavigatorButtonType.Remove)
{
SelectBankId = gridView1.GetFocusedRowCellValue(gridView1.Columns.ColumnByFieldName("BankId")).ToString();
BankEntity Bankacc = new BankEntity(SelectBankId);
adapter.DeleteEntity(Bankacc);
    
}
    
}


  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.