alidationContext.Items.Count is always returning 0

1 posts, 0 answers
  1. SivaPrasad Bevara
    SivaPrasad Bevara avatar
    73 posts
    Member since:
    Oct 2012

    Posted 22 Aug 2013 Link to this post

    Hi,

    We are using Telerik controls for Silverlight 5 (2013.2.625.1050) and RIA services.
    We need grid data in the custom validation for some validation. So in the view model we are adding the grid data to the validation context and trying to use the same in the custom validation method. But it is always returning the 0 records.

    if (e.Entities != null)
                {
                    var contextItems = new Dictionary<object, object>();
                    foreach (EmpDTO emp in e.Entities)
                    {
                        if (emp.Emp_CODE != 0)
                        {
                            contextItems.Add(emp.Emp_CODE, emp.Emp_ID);
                        }                   
                    }
                    this._context.ValidationContext = new System.ComponentModel.DataAnnotations.ValidationContext(_context, contextItems);
                }


    Please help.

    Regards,
    SivaPrasad.B
Back to Top