private void dgQueue_RowLoaded(object sender, RowLoadedEventArgs e) { GridViewRow GrdRow = e.Row as GridViewRow; EVQueue objEV = e.Row.DataContext as EVQueue; TextBlock txtActivityDate = null; TextBlock txtSendDate = null; int activityDateIndex = 0; if (GrdRow != null) { for (int index = 0; index < GrdRow.Cells.Count; index++) { if (GrdRow.Cells[index].Column.UniqueName.Equals("ActivityDate", StringComparison.OrdinalIgnoreCase)) { if (objEV.ActivityDate != null) { txtActivityDate = (TextBlock)e.Row.Cells[index].Content; activityDateIndex = index; } } if (GrdRow.Cells[index].Column.UniqueName.Equals("SendDate", StringComparison.OrdinalIgnoreCase)) { if (objEV.SendDate != null) { txtSendDate = (TextBlock)e.Row.Cells[index].Content; } } } if (!string.IsNullOrEmpty(txtActivityDate.Text) && !string.IsNullOrEmpty(txtSendDate.Text)) { if (Convert.ToDateTime(txtActivityDate.Text, CultureInfo.InvariantCulture) > Convert.ToDateTime(txtSendDate.Text, CultureInfo.InvariantCulture)) { e.Row.Cells[activityDateIndex].Background = Brushes.Yellow; } } } }
<telerik:radgridview name="dgQueue" xmlns:telerik="#unknown"> Grid.Row="2" Grid.Column="0" Height="580" HorizontalAlignment="Stretch" VerticalAlignment="Top" AutoGenerateColumns="False" FontSize="12" IsReadOnly="True" ItemsSource="{Binding}" ShowColumnFooters="true" ShowGroupPanel="False" telerikControls:StyleManager.Theme="Summer" UseLayoutRounding="True" RowLoaded="dgQueue_RowLoaded" AllowDrop="False" TabIndex="14" > <telerik:radgridview.columns> <telerik:gridviewdatacolumn width="*" uniquename="ActivityDate" name="datacolActivityDate"> DataMemberBinding="{Binding ActivityDate}" Header="Activity Date" /> <telerik:gridviewdatacolumn width="*" uniquename="SendDate"> DataMemberBinding="{Binding SendDate}" Header="Send Date" /> </telerik:gridviewdatacolumn></telerik:gridviewdatacolumn></telerik:radgridview.columns> </telerik:radgridview>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)