void FilterGrid() { NotificationData filterNotificationData = new NotificationData(); filterNotificationData.MachineCode = filterMachine.Text.Equals(filterMachineLabel) ? null : filterMachine.Text; NotificationData.errorCategory category = NotificationData.errorCategory.NA; Enum.TryParse(filterCategory.Text, out category); filterNotificationData.category = category; filterNotificationData.FilterNotifyStart = DateTime.Parse(filterStartDate.Value.ToString()); filterNotificationData.FilterNotifyEnd = DateTime.Parse(filterEndDate.Value.ToString()); notificationGrid.ItemsSource = objGeneralDba.GetNotifications(filterNotificationData); }