private void OnCustomersDataSourceLoadedData(object sender, Telerik.Windows.Controls.DomainServices.LoadedDataEventArgs e) { if (e.HasError) { e.MarkErrorAsHandled(); } }
private void OnDistinctValuesDataSourceLoadedData(object sender, Telerik.Windows.Controls.DomainServices.LoadedDataEventArgs e) { if (e.HasError) { e.MarkErrorAsHandled(); this.debugTextBox.Text = string.Format("<-- Server could not get distinct values for '{0}' column: {1}\r\n" , this.distinctValuesDataSource.QueryParameters[0].Value , e.Error); } else if (e.Cancelled) { this.debugTextBox.Text = string.Format("<-- Load operation was cancelled\r\n"); } else { TimeSpan elapsedTime = DateTime.Now - this.startTime; this.debugTextBox.Text += string.Format("<-- Server returned {0} distinct values for '{1}' column in {2} ms\r\n" , e.Entities.Count() , this.distinctValuesDataSource.QueryParameters[0].Value , elapsedTime.Milliseconds); List<string> list = new List<string>(); // You might want to limit the amount of distict values // if you think that the user can generate a very long query. foreach (DistinctValue dv in e.Entities) { list.Add(dv.Value); } this.distinctValues.AddRange(list); } }
void MyRadDomainDataSource_SubmittedChanges(object sender, Telerik.Windows.Controls.DomainServices.DomainServiceSubmittedChangesEventArgs e) { if (e.HasError) { //Avoids displaying errors, when deletion is prevented by DataBase constraints e.MarkErrorAsHandled(); } }
private void OnCustomersDataSourceLoadedData(object sender, Telerik.Windows.Controls.DomainServices.LoadedDataEventArgs e) { if (e.HasError) { e.MarkErrorAsHandled(); this.debugTextBox.Text = string.Format("<-- Server returned the following error: {0}\r\n" , e.Error); } else if (e.Cancelled) { this.debugTextBox.Text = string.Format("<-- Load operation was cancelled\r\n"); } else { TimeSpan elapsedTime = DateTime.Now - this.startTime; this.debugTextBox.Text += string.Format("<-- Server returned {0} entities {1} ms\r\n" , e.Entities.Count() , elapsedTime.Milliseconds); } }