Ejemplo n.º 1
0
        private void gridView_RowValidating(object sender, Telerik.Windows.Controls.GridViewRowValidatingEventArgs e)
        {
            // There is no need to add this validation here
            // How to aviod sending rubbish to the OData Service?
            // Just for testing

            Pais country = e.Row.DataContext as Pais;

            /*
             * if (string.IsNullOrEmpty(country.nombre) || country.nombre.Length < 3)
             * {
             *  GridViewCellValidationResult validationResult = new GridViewCellValidationResult();
             *  validationResult.PropertyName = "Nombre";
             *  validationResult.ErrorMessage = "Nombre is required and must be at least five characters";
             *  e.ValidationResults.Add(validationResult);
             *  e.IsValid = false;
             * }
             *
             * if (country.id < 0)
             * {
             *  GridViewCellValidationResult validationResult = new GridViewCellValidationResult();
             *  validationResult.PropertyName = "Id";
             *  validationResult.ErrorMessage = "Id must be positive";
             *  e.ValidationResults.Add(validationResult);
             *  e.IsValid = false;
             * }*/
        }
Ejemplo n.º 2
0
        private void OnRowValidating(Telerik.Windows.Controls.GridViewRowValidatingEventArgs e)
        {
            // check row whether distribution is consistent
            CashFlowDetail detail = (CashFlowDetail)e.Row.Item;

            if (detail.CashFlowAmountDistribution == 0)
            {
                return;                                         //no checks in case of a capital call
            }
            double difference = (detail.CashFlowAmountDistribution - detail.ReturnOfCapital - detail.CapitalGain - detail.Dividends - detail.RecallableAmount - detail.WithholdingTax);

            if (Math.Round(difference, 2) == 0)
            {
                return;
            }
            e.ValidationResults.Add(new Telerik.Windows.Controls.GridViewCellValidationResult()
            {
                ErrorMessage = $"Die Ausschüttungskomponenten entsprechen nicht dem Ausschüttungsbetrag. Die Differenz beträgt {difference:n2}."
            });
        }
Ejemplo n.º 3
0
 private void RadGridView_RowValidating(object sender, Telerik.Windows.Controls.GridViewRowValidatingEventArgs e)
 {
     e.IsValid = false;
 }
Ejemplo n.º 4
0
 private void gridView_RowValidating(object sender, Telerik.Windows.Controls.GridViewRowValidatingEventArgs e)
 {
     // There is no need to add this validation here
     // How to aviod sending rubbish to the OData Service?
     // Just for testing
 }