How to save an updated row in a typed list?

Posts   
 
    
sekobey
User
Posts: 12
Joined: 24-Mar-2005
# Posted on: 30-Mar-2005 13:44:01   

Hello there,

My data grid consist of a typed list and i want to save updated row or rows to database.I use adapter.Is there any method in typed list can do this action?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 31-Mar-2005 11:49:34   

No, a typed list is for readonly purposes. you could read the entities using PK values stored in the typed list and update teh values that way.

Frans Bouma | Lead developer LLBLGen Pro
sekobey
User
Posts: 12
Joined: 24-Mar-2005
# Posted on: 31-Mar-2005 12:20:32   

thanks a lot, well o more thing.I want to upgrade my data grid.You see,i add new record to my db and i want to see this new record in my data grid and this data grid is binded to the typed list talked above.How can i do that? Refresh() metod of grid does not work.I think that i can refetch typed list and rebind it again.But it is cumbersome.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 31-Mar-2005 12:32:12   

sekobey wrote:

thanks a lot, well o more thing.I want to upgrade my data grid.You see,i add new record to my db and i want to see this new record in my data grid and this data grid is binded to the typed list talked above.How can i do that? Refresh() metod of grid does not work.I think that i can refetch typed list and rebind it again.But it is cumbersome.

No, just refetch the typed list. This is obvious: it's a disconnected object, it doesn't know of any dataupdates in the db, so you have to re-read the data if something changed.

Frans Bouma | Lead developer LLBLGen Pro
sekobey
User
Posts: 12
Joined: 24-Mar-2005
# Posted on: 31-Mar-2005 12:45:20   

No, just refetch the typed list. This is obvious: it's a disconnected object, it doesn't know of any dataupdates in the db, so you have to re-read the data if something changed.

if a refetch typed list, is that enough?.I mean Do i have to any change on the code such as remove bindings and rebind them.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 31-Mar-2005 13:25:05   

No, that shouldn't be necessary. Just: typedList.Rows.Clear(); and fill the typedlist again.

Frans Bouma | Lead developer LLBLGen Pro