<ControlTemplate x:Key="EditAppointmentTemplate" TargetType="{x:Type telerik:SchedulerDialog}">
<Grid VerticalAlignment="Center" Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Content="Number of Tap Activity" Height="25"/>
<telerik:RadNumericUpDown Grid.Column="1" Height="25" Width="50" NumberDecimalDigits="0" ValueFormat="Numeric" HorizontalAlignment="Left"
Value="{Binding Occurrence.Appointment.TapActivityNum, Mode=TwoWay}" />
</Grid>
</ControlTemplate>
<Style x:Key="EditAppointmentStyle" TargetType="telerik:SchedulerDialog">
<Setter Property="Width" Value="250" />
<Setter Property="Height" Value="100" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template" Value="{StaticResource EditAppointmentTemplate}" />
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Number of Tap Activity" />
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>

foreach (ClienteBE _cliente in this.lstCliente) { tam = _cliente.Nome.Length > tam ? _cliente.Nome.Length : tam; this.cmbCliente.DisplayMemberPath = "Nome"; this.cmbCliente.Items.Add(_cliente); }Hi,
I am working with RadGridView, in MVVM WPF application and I need to validate cell compared to other values in binding collection.
I have a object :
public class MyObject
{
public DateTime DateBegin { get; set;}
public int Value { get; set;}
}
And if I add a new row in my GridView with existing Date I want to show error message in cell.
I thought to use an ValidationRules in my cell, but i am not sure if i can compared to with others values in binding list.
I found some solution, but isn't MVVM compliant :
public void RadGridView1_CellValidating(object sender, GridViewCellValidatingEventArgs e) { bool isValid = true; string validationText = "Validation failed. "; if(cell.column.uniquename == "mydatecolumn") { GridViewCell cell = e.Cell; isValid = ValidateDate((datetime) e.NewValue); if (!isValid) { validationText += "You already used that date, mate."; } }} private static bool ValidateDate(datetime newDate) { // Some linq to see if it's in your collection or not }