or
| HTML |
| <telerik:RadGrid ID="grid_utenti" runat="server" AllowAutomaticInserts="false" |
| AllowAutomaticUpdates="false" |
| OnNeedDataSource="grid_utenti_NeedDataSource" |
| OnItemCommand="grid_utenti_ItemCommand"> |
| CS |
| protected void grid_utenti_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) |
| { |
| grid_utenti.DataSource = call to a method that returns a dataset; |
| } |
| protected void grid_utenti_ItemCommand(object sender, GridCommandEventArgs e) |
| { |
| if (e.CommandName == RadGrid.PerformInsertCommandName || e.CommandName == RadGrid.UpdateCommandName) |
| { |
| try |
| { |
| //call to method that insert/update |
| } |
| catch(Exception exc) |
| { |
| e.Canceled = true; |
| } } |
Thank you
Alessandra