or
public void GeneratingProperty(AutoGeneratingPropertyDefinitionEventArgs e){ try { AvailableProperties property = (AvailableProperties)Enum.Parse(typeof(AvailableProperties), e.PropertyDefinition.Binding.Path.Path); if (IsAvailable(item.GetAvailableProperties(), property)) { switch (property) { case AvailableProperties.Title: FrameworkElementFactory textBoxFactory = new FrameworkElementFactory(typeof(TextBox)); textBoxFactory.AddHandler(TextBox.TextChangedEvent, new TextChangedEventHandler(TitleTextChanged)); textBoxFactory.SetValue(TextBox.BackgroundProperty, System.Windows.Media.Brushes.Tomato); textBoxFactory.SetValue(TextBox.BorderBrushProperty, System.Windows.Media.Brushes.Transparent); textBoxFactory.SetBinding(TextBox.TextProperty, new Binding("Title")); DataTemplate template = new DataTemplate(); template.VisualTree = textBoxFactory; template.Seal(); e.PropertyDefinition.EditorTemplate = template; e.PropertyDefinition.OrderIndex = 0; e.PropertyDefinition.DisplayName = "Title"; e.PropertyDefinition.Description = "The title of the attribute. Can only contain letters, numbers, and underscores."; break; default: // other properties go in case statements above here break; } } else { e.Cancel = true; } } catch { e.Cancel = true; }}public void TitleTextChanged(object sender, TextChangedEventArgs e){ if (sender is TextBox) { TextBox titleTextBox = (TextBox)sender; int caretIndex = titleTextBox.CaretIndex; string newValue = titleTextBox.Text; item.Title = newValue; ApplyCorrectedValue(newValue, item.Title, titleTextBox, caretIndex); NotifyOfPropertyChange(() => MappingsPanel); } else { Logger.Log("TitleChanged: source must be a TextBox"); throw new ArgumentException("source must be a TextBox"); }}Hi ya, I'm trying to populate one RadGridView using an UDF Sql Server which waits a parameter but it doesn't work:
XAML:
<telerik:RadGridView x:Name="dgvHistoricoOR" HorizontalAlignment="Left" FontFamily="Segoe UI" FontSize="12" FontStyle="Normal" Margin="10,44,-185,0" VerticalAlignment="Top" Height="175" Width="437" ColumnWidth="SizeToCells" Grid.ColumnSpan="2" Grid.RowSpan="2"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn DataMemberBinding="{Binding ord_repalpha}" Header="{Resx RadGridViewOr_Or}" Width="40"/> <telerik:GridViewDataColumn DataMemberBinding="{Binding F_Alta}" Header="{Resx RadGridViewOr_Alta}" Width="60"/> <telerik:GridViewDataColumn DataMemberBinding="{Binding F_Cierre}" Header="{Resx RadGridViewOr_Cierre}" Width="60"/> </telerik:RadGridView.Columns>ada = New SqlDataAdapter("SELECT * FROM OR_Historico_Por_Cliente(@par1)", aBD.connection) ada.SelectCommand.Parameters.AddWithValue("@par1", Documento) ada.Fill(ds, "OR_Historico_Por_Cliente") Me.dgvHistoricoOR.ItemsSource = "OR_Historico_Por_Cliente" Me.dgvHistoricoOR.DataContext = dsI don't get data, my Grid remains empty
I wonder, when I call Fill method, should I include the value for the parameter???
<UserControl.Resources> <Style x:Key="DraggableListBoxItem" TargetType="controls4:RadListBoxItem"> <Setter Property="dragDrop:DragDropManager.AllowCapturedDrag" Value="True" /> <Setter Property="dragDrop:DragDropManager.AllowDrag" Value="True" /> </Style> </UserControl.Resources><ListBox Grid.Row="2" x:Name="List1" ItemsSource="{Binding Source1, Mode=TwoWay}" AllowDrop="True" IsSynchronizedWithCurrentItem="True" Style="{StaticResource ListBoxStyleMenu}" Margin="2,2,2,2" VerticalAlignment="Stretch" HorizontalContentAlignment="Center" HorizontalAlignment="Stretch"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <UniformGrid Columns="2" /> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemContainerStyle> <Style TargetType="{x:Type ListBoxItem}"> <Setter Property="Focusable" Value="False"/> <Setter Property="Margin" Value="0,5,0,5" /> </Style> </ListBox.ItemContainerStyle> </ListBox><ListBox Grid.Row="2" x:Name="List2" ItemsSource="{Binding Source2, Mode=TwoWay}" AllowDrop="True" IsSynchronizedWithCurrentItem="True" Style="{StaticResource ListBoxStyleMenu}" Margin="2,2,2,2" VerticalAlignment="Stretch" HorizontalContentAlignment="Center" HorizontalAlignment="Stretch"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <UniformGrid Columns="2" /> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemContainerStyle> <Style TargetType="{x:Type ListBoxItem}"> <Setter Property="Focusable" Value="False"/> <Setter Property="Margin" Value="0,5,0,5" /> </Style> </ListBox.ItemContainerStyle> </ListBox><controls4:RadListBox x:Name="List3" ItemsSource="{Binding Source3}" AllowDrop="False" SelectedItem="{Binding SourceSelected, Mode=TwoWay}" VerticalAlignment="Stretch" HorizontalContentAlignment="Center" HorizontalAlignment="Stretch" Margin="2,2,2,2" ItemContainerStyle="{StaticResource DraggableListBoxItem}"> <controls4:RadListBox.DragDropBehavior> <behaviors:ListBoxDragDropBehavior AllowReorder="True" dragDrop:DragDropManager.TouchDragTrigger="TapAndHold" /> </controls4:RadListBox.DragDropBehavior> </controls4:RadListBox>I am able to get the Mockup using CandleStick chart.. Please look into the attached Screenshot.
Can somebody help me in solving the below 2 issues..
1. I have to display the "HighValue" and "LowValue" at the top and bottom of every item as in the mockup.
2. Using Annotation, I have drawn a line at the value of "13" and i have named the Label as "BASE VALUE".
I want that label to be displayed outside the graph as in the mockup.
<telerik:RadCartesianChart x:Name="xCartesianChart" Height="300" Width="400" Palette="Windows8" > <telerik:RadCartesianChart.VerticalAxis> <telerik:LinearAxis x:Name="verticalAxis" HorizontalLocation="Left"/> </telerik:RadCartesianChart.VerticalAxis> <telerik:RadCartesianChart.HorizontalAxis > <telerik:CategoricalAxis VerticalLocation="Top" LineThickness="1" LabelInterval="2" ShowLabels="True"/> </telerik:RadCartesianChart.HorizontalAxis> <telerik:CandlestickSeries x:Name="xCandleStick" CategoryBinding="XValue" LowBinding="YValue2" HighBinding="YValue" CloseBinding="YValue2" OpenBinding="YValue" ShowLabels="True"/> <telerik:RadCartesianChart.Annotations> <telerik:CartesianGridLineAnnotation Axis="{Binding ElementName=verticalAxis}" Label="BASE VALUE" Value="13" Stroke="Green"> <telerik:CartesianGridLineAnnotation.LabelDefinition> <telerik:ChartAnnotationLabelDefinition Location="Left" VerticalAlignment="Top" VerticalOffset="0" HorizontalOffset="80"/> </telerik:CartesianGridLineAnnotation.LabelDefinition> </telerik:CartesianGridLineAnnotation> </telerik:RadCartesianChart.Annotations> </telerik:RadCartesianChart>//Code-behind public MainWindow() { InitializeComponent(); PopulateCartesianChart(); } void PopulateCartesianChart() { Random rnd = new Random(); List<ChartDataClass> chartDatas = new List<ChartDataClass>(); for (int i = 0; i < 20; i++) { ChartDataClass cdc = new ChartDataClass(); cdc.XValue = i; cdc.YValue = rnd.NextDouble() * 100; cdc.YValue2 = cdc.YValue - 50; chartDatas.Add(cdc); } xCartesianChart.Series[0].ItemsSource = chartDatas; }