List<Employee> list = new List<Employee>();
list.Add(new Employee() { Name = "Nancy", City = "Tokyo", Phone = "000-88888888", Age = 30, IsMale = false });
list.Add(new Employee() { Name = "Janet", City = "Sendai", Phone = "000-88888888", Age = 20, IsMale = true });
list.Add(new Employee() { Name = "Rose", City = "Tokyo", Phone = "000-88888888", Age = 40, IsMale = false });
list.Add(new Employee() { Name = "Buchanan", City = "Osaka", Phone = "000-88888888", Age = 20, IsMale = true });
list.Add(new Employee() { Name = "Leverling", City = "Tokyo", Phone = "000-88888888", Age = 30, IsMale = false });
list.Add(new Employee() { Name = "Gavin", City = "Nagoya", Phone = "000-88888888", Age = 40, IsMale = true });
list.Add(new Employee() { Name = "Apple", City = "Osaka", Phone = "000-88888888", Age = 20, IsMale = false });
list.Add(new Employee() { Name = "Tim", City = "Nara", Phone = "000-88888888", Age = 30, IsMale = true });
gcSpreadGrid1.ItemsSource = list;
gcSpreadGrid1.Columns["Phone"].CellValidator = CellValidator.CreateTextLengthValidator(ComparisonOperator.EqualTo, 12, null, "The phone string's length must be 12.");
gcSpreadGrid1.Columns["City"].CellValidator = CellValidator.CreateListValidator("Tokyo, Sendai, Osaka, Nagoya, Nara", "Only 'Tokyo', 'Sendai', 'Osaka', 'Nagoya', 'Nara' are availidate");
Dim list As New List(Of Employee)()
list.Add(New Employee() With { _
.Name = "Nancy", _
.City = "Tokyo", _
.Phone = "000-88888888", _
.Age = 30, _
.IsMale = False _
})
list.Add(New Employee() With { _
.Name = "Janet", _
.City = "Sendai", _
.Phone = "000-88888888", _
.Age = 20, _
.IsMale = True _
})
list.Add(New Employee() With { _
.Name = "Rose", _
.City = "Tokyo", _
.Phone = "000-88888888", _
.Age = 40, _
.IsMale = False _
})
list.Add(New Employee() With { _
.Name = "Buchanan", _
.City = "Osaka", _
.Phone = "000-88888888", _
.Age = 20, _
.IsMale = True _
})
list.Add(New Employee() With { _
.Name = "Leverling", _
.City = "Tokyo", _
.Phone = "000-88888888", _
.Age = 30, _
.IsMale = False _
})
list.Add(New Employee() With { _
.Name = "Gavin", _
.City = "Nagoya", _
.Phone = "000-88888888", _
.Age = 40, _
.IsMale = True _
})
list.Add(New Employee() With { _
.Name = "Apple", _
.City = "Osaka", _
.Phone = "000-88888888", _
.Age = 20, _
.IsMale = False _
})
list.Add(New Employee() With { _
.Name = "Tim", _
.City = "Nara", _
.Phone = "000-88888888", _
.Age = 30, _
.IsMale = True _
})
gcSpreadGrid1.ItemsSource = list
gcSpreadGrid1.Columns("Phone").CellValidator = CellValidator.CreateTextLengthValidator(ComparisonOperator.EqualTo, 12, Nothing, "The phone string's length must be 12.")
gcSpreadGrid1.Columns("City").CellValidator = CellValidator.CreateListValidator("Tokyo, Sendai, Osaka, Nagoya, Nara", "Only 'Tokyo', 'Sendai', 'Osaka', 'Nagoya', 'Nara' are availidate")