Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RowChanged Event Class
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01428065
Message ID:
01428080
Vues:
35
>Instead of calling this:
>
>
>private void CommitChanges(DataSet ds)
>{    
>	foreach (DataTable dt in ds.Tables)    
>	{        
>		foreach (DataRow dr in ds.Tables)        
>		{            
>			dr.EndEdit();        
>		}    
>	}
>}
>
>
>
>why not do this when I create the table:
>
>
>dt.ColumnChanged += new DataColumnChangeEventHandler(dt_ColumnChanged);
>
>
>then in the event do this:
>
>
>void dt_ColumnChanged(object sender, DataColumnChangeEventArgs e){    e.Row.EndEdit();}
>
>
>This would fire each time the user changes a bound item on a form, wouldn't it? If so, them I'm assured that the table's rowstate
>would always show modifed for changed items.

I guess it depends on how you expect the user to behave. If they make a ton of changes and don't save then the event has fired a lot of times to no purpose. If, OTOH, you expect only one or two changes then using the event approach might be more efficient.....
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform