measures.Add(new RandomItem{ Date = DateTime.Now.AddDays(-3).Date, ValOne= 5, ValTwo = 4, ValThree = 3, ValFour = 2, ValFive = 1 });measures.Add(new RandomItem{ Date = DateTime.Now.AddDays(-2).Date, ValOne= 5, ValTwo = 7, ValThree = 3, ValFour = 2, ValFive = 1 });<telerik:ChartArea.AxisX> <telerik:AxisX LabelRotationAngle="90" Title="Day of Month" IsDateTime="True" /> </telerik:ChartArea.AxisX>void Page1_Loaded(object sender, RoutedEventArgs e) {ds = letterservice.ExecuteTag("SearchPatient", new System.Collections.Generic.KeyValuePair<string, object>[] { new System.Collections.Generic.KeyValuePair<string, object>("@0", 135) });AddMergeFieldsInDropDownContent(this.btnModule, ds); ds = letterservice.ExecuteTag("SearchPatientImmunization", new System.Collections.Generic.KeyValuePair<string, object>[] { new System.Collections.Generic.KeyValuePair<string, object>("@0", 8) });AddMergeFieldsInDropDownContent(this.btnSubModule, ds);this.radRichTextBox.ChangeAllFieldsDisplayMode(FieldDisplayMode.Result);} private void AddMergeFieldsInDropDownContent(RadRibbonDropDownButton radRibbonDropDownButton, DataSet ds) { Grid grid = new Grid(); int count = 200; //grid.Height = 400; ScrollViewer scrollViewer = new ScrollViewer(); scrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Auto; StackPanel stackPanel = new StackPanel(); // this.DataContext = this; this.radRichTextBox.Document.MailMergeDataSource.ItemsSource = ds.Tables[0].DefaultView; foreach (string fieldName in this.radRichTextBox.Document.MailMergeDataSource.GetColumnNames()) { RadRibbonButton fieldButton = new RadRibbonButton { Text = fieldName, Size = ButtonSize.Medium, HorizontalAlignment = HorizontalAlignment.Stretch, HorizontalContentAlignment = HorizontalAlignment.Left }; count++; fieldButton.Command = this.radRichTextBox.Commands.InsertFieldCommand; fieldButton.CommandParameter = new MergeField { PropertyPath = fieldName }; stackPanel.Children.Add(fieldButton); } grid.Height = count; stackPanel.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch; scrollViewer.Content = stackPanel; grid.Children.Add(scrollViewer); radRibbonDropDownButton.DropDownContent = grid; }
public class ValueToColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
var brush = new SolidColorBrush(Colors.Black);
Double doubleValue = 0.0;
Double.TryParse(value.ToString(), out doubleValue);
if (doubleValue < 0)
brush =
new SolidColorBrush(Colors.Red);
return brush;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
public class TargetExposureConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
if (values == null)
return null;
if (values.Length != 2)
throw new ApplicationException("Expecting 2 parameters in TargetExposureConverter");
var targetExposureCmdParameter = new TargetExposureEditedCmdParam();
decimal value;
decimal.TryParse(System.Convert.ToString(values[0]), out value);
targetExposureCmdParameter.TargetExposure = value;
var targetExposureCell = values[1] as GridViewCell;
if (targetExposureCell != null && targetExposureCell.ParentRow != null)
{
targetExposureCmdParameter.CurrentRow = targetExposureCell.ParentRow.Item
as CcyExposureCurrencySummary;
}
return targetExposureCmdParameter;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
public class RadMaskedInputValueChangingBehavior : Behavior<RadMaskedInputBase>
{
protected override void OnAttached()
{
base.OnAttached();
AssociatedObject.ValueChanging += OnValueChanging;
}
protected override void OnDetaching()
{
base.OnDetaching();
AssociatedObject.ValueChanging -= OnValueChanging;
}
void OnValueChanging(object sender, RadMaskedInputValueChangingEventArgs e)
{
var maskedInputControl = sender as RadMaskedNumericInput;
if (maskedInputControl == null)
return;
if (e.NewValue == null)
return;
double newVal;
if (!double.TryParse(Convert.ToString(e.NewValue), out newVal))
return;
maskedInputControl.Foreground = newVal < 0
?
Brushes.Red
:
Brushes.Black;
}
}
