This is a migrated thread and some comments may be shown as answers.

alidationContext.Items.Count is always returning 0

0 Answers 39 Views
GridView
This is a migrated thread and some comments may be shown as answers.
SivaPrasad Bevara
Top achievements
Rank 1
SivaPrasad Bevara asked on 22 Aug 2013, 01:57 PM
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

No answers yet. Maybe you can help?

Tags
GridView
Asked by
SivaPrasad Bevara
Top achievements
Rank 1
Share this question
or