Telerik Forums
UI for WPF Forum
2 answers
188 views
I have a RadChart that has a dynamic set of lineSeries that i add to it after recieving the data from an end device.  When i try to clear the Chart for new data, the legend Items do not get cleared. 
private void AddTrendPoints(TrendFiles trendfile)
        {
            if (this.trendGraph.Dispatcher.Thread != Thread.CurrentThread)
            {
                this.trendGraph.Dispatcher.Invoke(DispatcherPriority.Normal, new DispatcherOperationCallback(delegate
                {
                     
                    #region Setup Series
                    this.trendGraph.DefaultView.ChartArea.DataSeries.Clear();
                    this.trendGraph.DefaultView.ChartArea.Legend.Items.Clear();
                    this.trendGraph.SamplingSettings.SamplingThreshold = trendfile.Records;
                    DataSeries series = new DataSeries();
                    LineSeriesDefinition lineDefinition = new LineSeriesDefinition();
                    ChartLegendItem legendItem = new ChartLegendItem();
                    int count = 0;
  
                    foreach(TrendVariable trendVar in trendfile.Variables)
                    {
                        series = new DataSeries();
                        lineDefinition = new LineSeriesDefinition();
                        legendItem = new ChartLegendItem();
                        lineDefinition.ShowItemLabels = false;
                        lineDefinition.ShowPointMarks = false;
                        lineDefinition.SeriesName = trendVar.Name;
                        lineDefinition.LegendDisplayMode = LegendDisplayMode.SeriesLabel;
                        series.LegendLabel = trendVar.Name;
                        series.Definition = lineDefinition;
                        series.Definition.Appearance.Stroke = colors[count];
                        series.Definition.Appearance.Fill = colors[count];
                        legendItem.Label = trendVar.Name;
                        legendItem.Background = colors[count];
                        legendItem.Foreground = Brushes.White;
                        trendGraph.DefaultView.ChartLegend.Items.Add(legendItem);
                          
                        foreach (DataPoint point in trendVar.points)
                        {
                            series.Add(point);
                        }
  
                        trendGraph.DefaultView.ChartArea.DataSeries.Add(series);
                         
                        count++;
                    }
  
                    #endregion
  
  
                    return null;
                }), null);
  
            }
            else
            {
                #region Setup Series
                this.trendGraph.DefaultView.ChartArea.DataSeries.Clear();
                this.trendGraph.DefaultView.ChartArea.Legend.Items.Clear();
  
                DataSeries series = new DataSeries();
                LineSeriesDefinition lineDefinition = new LineSeriesDefinition();
                ChartLegendItem legendItem = new ChartLegendItem();
                int count = 0;
  
                foreach (TrendVariable trendVar in trendfile.Variables)
                {
                    series = new DataSeries();
                    lineDefinition = new LineSeriesDefinition();
                    legendItem = new ChartLegendItem();
                    lineDefinition.ShowItemLabels = false;
                    lineDefinition.ShowPointMarks = false;
                    lineDefinition.SeriesName = trendVar.Name;
                    lineDefinition.LegendDisplayMode = LegendDisplayMode.SeriesLabel;
                    series.LegendLabel = trendVar.Name;
                    series.Definition = lineDefinition;
                    series.Definition.Appearance.Stroke = colors[count];
                    series.Definition.Appearance.Fill = colors[count];
                    legendItem.Label = trendVar.Name;
                    legendItem.Background = colors[count];
                    legendItem.Foreground = Brushes.White;
                    trendGraph.DefaultView.ChartLegend.Items.Add(legendItem);
                    foreach (DataPoint point in trendVar.points)
                    {
                        series.Add(point);
                    }
                    trendGraph.DefaultView.ChartArea.DataSeries.Add(series);
                    count++;
                }
  
                #endregion
  
            }
  
        }


After the initial load, the legend items just append to the legend.  So i get repeat Series legend items.  Its not being cleared on the Legend.Items.Clear() method.

Brian
Top achievements
Rank 1
 answered on 02 Feb 2011
1 answer
73 views
   Hi Telerik,

I have a couple of question about how to change the appeance of the selection style.

1. I have disabled editing and do not wish the selection to display a rectangular border around the clicked cell, i just want the row to be selected as per default when the application starts and no cell has been clicked.

2. Can I remove the selection style completely? I'm using the treelistview to display a set of data where I have disabled selection, but when I populate the data, as per default the first item is selected and given the selection style which ruins the layout abit. I still wish to keep the rowheader but without the arrow icon used for selection.

Thanks in advance,

/Kasper Schou
Vanya Pavlova
Telerik team
 answered on 02 Feb 2011
4 answers
167 views
Hello, 

I have the need to be able to persist and restore the state of a RadDataFilter.  I was hoping to be able to save-off and restore the FilterDescriptors collection, but unfortunately it is read-only.  So, what would be the best approach to making this happen?  Is persistence supported at all?

Thanks,
Mark


Mark
Top achievements
Rank 1
 answered on 02 Feb 2011
2 answers
146 views
Hi,

I have a problem using the
  • GridViewCheckBoxColumn
  • GridViewComboBoxColumn
When I edit data in a "GridViewDataColumn" and execute my custom "UpdateItemCommand" I have no problems and my SelectedItem displays the changes which were entered in the "GridViewDataColumn".
However the problem occurs when I edit a "GridViewCheckBoxColumn" or "GridViewComboBoxColumn". The SelectedItem does not display the changes made by these Columns.

Thank you for your help!
Martin

<my:RadGridView x:Name="RadGridView" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" ItemsSource="{Binding PLC_Items}>
        <my:RadGridView.Columns>
            <my:GridViewDataColumn Header="ID" DataMemberBinding="{Binding ID}" IsReadOnly="True"/>
            <my:GridViewDataColumn Header="ItemName" DataMemberBinding="{Binding Name}" Width="*"/>
            <my:GridViewComboBoxColumn Header="Function" ItemsSource="{Binding AllFunctions}" DataMemberBinding="{Binding Function}"/>
            <my:GridViewCheckBoxColumn Header="Auto Update" DataMemberBinding="{Binding AutoUpdate, Mode=TwoWay}"/>
            <my:GridViewColumn Width="Auto">
                <my:GridViewColumn.CellTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal" Margin="2">
                            <telerik:RadButton Command="{Binding DataContext.WriteItemCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type my:RadGridView}}}"/>
                            <telerik:RadButton Command="{Binding DataContext.UpdateItemCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type my:RadGridView}}}"/>
                            <telerik:RadButton Command="{Binding DataContext.ReadItemCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type my:RadGridView}}}"/>
                            <telerik:RadButton Command="{Binding DataContext.DeleteItemCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type my:RadGridView}}}"/>
                        </StackPanel>
                    </DataTemplate>
                </my:GridViewColumn.CellTemplate>
            </my:GridViewColumn>
        </my:RadGridView.Columns>
    </my:RadGridView>


Martin
Top achievements
Rank 1
 answered on 02 Feb 2011
1 answer
190 views

Hello

When the Grid View Data Column bound to date time,

If there is string format that show only the time it looks like bug.

We need that the filtering controls display the same date once.

Looks at the attach pictures.

How to resolve this problem?

Best regards

Ehud.

Ivan Ivanov
Telerik team
 answered on 02 Feb 2011
1 answer
214 views
Hello friends,

I am trying to implement the MouseLeftButtonDown-Event for some PanelBarItems. But the Event isn't fired. Could you please help me to find out why it isn't?

<telerik:RadPanelBar ExpandMode="Multiple" VerticalAlignment="Stretch" Name="pbarMain">
    <!-- Kapazitäten -->
    <telerik:RadPanelBarItem VerticalAlignment="Stretch" IsExpanded="True">
        <telerik:RadPanelBarItem.Header>
            <StackPanel Orientation="Horizontal" Margin="5 4 5 5">
                <Image Source="Images/kapazität.ico"
                       Style="{StaticResource style_image_20x20}"/>
                <Label Content="Kapazitäten" FontWeight="Bold"/>
            </StackPanel>
        </telerik:RadPanelBarItem.Header>
     
        <telerik:RadPanelBarItem MouseLeftButtonDown="RadPanelBarItem_MouseDown"
                                 Tag="KapaViewPage.xaml">
            <telerik:RadPanelBarItem.Header>
                <StackPanel Orientation="Horizontal" Margin="10 4 5 5">
                    <Image Source="Images/Document_search.ico"
                           Style="{StaticResource style_image_16x16}"/>
                    <Label Content="Anzeigen/Bearbeiten"/>
                </StackPanel>
            </telerik:RadPanelBarItem.Header>
        </telerik:RadPanelBarItem>


private void RadPanelBarItem_MouseDown(object sender, MouseButtonEventArgs e)
{
    if (sender != null)
    {
        RadPanelBarItem item = sender as RadPanelBarItem;
        if (item.Tag != null)
        {
            string ziel = item.Tag.ToString();
 
            if (ziel.Length > 0) mvm.Navigate(ziel);
        }
    }
}



Petar Mladenov
Telerik team
 answered on 02 Feb 2011
2 answers
183 views

Hi,
Previously I was using this code in WPF .net 4.0 framework and was working correctly.

Code at RowLoaded Event:
 

TreeListViewRow row = e.Row as TreeListViewRow; 
   
Binding binding = new Binding("IsExpanded") { Source = row.Item }; 
  
binding.Mode = BindingMode.TwoWay; 
  
row.SetBinding(TreeListViewRow.IsExpandedProperty, binding);

 

 

 

which indirectly calls the

RowIsExpandedChanging event somehow.
But now when I migrated to .net 3.5 framework, due to some limitations, the same code was not working.
Now it is not calling the RowIsExpandedChanging event.
Please suggest me how to overcome from this problem, is there any other way to do the same in .net 3.5.

Thanks in Advance.

 

 

 

Manishkumar
Top achievements
Rank 1
 answered on 02 Feb 2011
3 answers
141 views
Hi, I have a problem when populating stacked bar charts. My code is following:
XMAL:
<telerik:RadChart x:Name="chart" PaletteBrushesRepeat="False" telerik:Theming.Theme="Summer">
 </telerik:RadChart>

C#:
chart.SeriesMappings.Clear();
            chart.DefaultView.ChartArea.DataSeries.Clear();
            chart.DefaultView.ChartLegend.UseAutoGeneratedItems = true;
            chart.DefaultSeriesDefinition.LegendDisplayMode = LegendDisplayMode.SeriesLabel;
             
            for (int i = 0; i < model.Captions.Count; i++ )
            {
                SeriesMapping sm = new SeriesMapping();
                StackedBarSeriesDefinition dd = new StackedBarSeriesDefinition();
                 
                dd.StackGroupName = "Stack1";
                sm.SeriesDefinition = dd;
                sm.LegendLabel = "Stacked Bar " + i;
                sm.CollectionIndex = i;
                 
                ItemMapping im1 = new ItemMapping();
                im1.DataPointMember = DataPointMember.YValue;
                sm.ItemMappings.Add(im1);
                chart.SeriesMappings.Add(sm);
            }
 
            List<double[]> itemsSource = new List<double[]>();
            for (int i = 0; i < model.Children.Count; i++)
            {
                double[] d =  model.Children[i].Values.Select(s => s.AdjustedValue).ToArray();
                itemsSource.Add(d);
            }

I'm not sure where I'm going wrong here but I'd thought "sm.LegendLabel = "Stacked Bar " + i; " would provide my with legend items.

Best regards
Kristján.
Kristjan Einarsson
Top achievements
Rank 1
 answered on 02 Feb 2011
4 answers
121 views
Hi There

I have a menu which contains a gridview, I cant seem to drag column headers to the group header though when in that menu. The menu just dissappears. Code for the grid below:

<telerikGridView:RadGridView x:Name="radGridAssets" Grid.Column="0" Grid.Row="0"
                                             Margin="0" ShowGroupPanel="True" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
                                             ShowInsertRow="False" RowIndicatorVisibility="Collapsed"
                                             AutoGenerateColumns="False"
                                             ItemsSource="{Binding FullAssetList}">
 
            <!--<telerikGridView:RadGridView.GroupDescriptors>
                <telerikData:GroupDescriptor Member="SiteName" />
            </telerikGridView:RadGridView.GroupDescriptors>-->
            <telerikGridView:RadGridView.SortDescriptors>
                <telerikData:SortDescriptor Member="SiteId" SortDirection="Ascending" />
                <telerikData:SortDescriptor Member="OrderByProcessType" SortDirection="Ascending" />
            </telerikGridView:RadGridView.SortDescriptors>
            <telerikGridView:RadGridView.Columns>
                <telerikGridView:GridViewDataColumn Header="" Width="Auto">
                    <telerikGridView:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <CheckBox x:Name="chkSelectedAsset" IsChecked="{Binding IsSelected, Mode=TwoWay}"
                                      Unchecked="chkSelectedAsset_Unchecked" Checked="chkSelectedAsset_Checked" />
                        </DataTemplate>
                    </telerikGridView:GridViewDataColumn.CellTemplate>
                </telerikGridView:GridViewDataColumn>
                <telerikGridView:GridViewDataColumn Header="Site" DataMemberBinding="{Binding SiteName}" IsReadOnly="True">
                    <telerikGridView:GridViewDataColumn.GroupHeaderTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" >
                                <TextBlock Text="{Binding Group.Key}" />
                                <Button x:Name="buttAssetGridSelectAll" Margin="5,0,0,0" Content="All" FontSize="10" Tag="{Binding Group}" Click="buttAssetGridSelectAll_Click"  />
                                <Button x:Name="buttAssetGridSelectNone" Content="None" FontSize="10" Tag="{Binding Group}" Click="buttAssetGridSelectNone_Click" />
                            </StackPanel>
                        </DataTemplate>
                    </telerikGridView:GridViewDataColumn.GroupHeaderTemplate>
                </telerikGridView:GridViewDataColumn>
                <telerikGridView:GridViewDataColumn Header="Asset Name" DataMemberBinding="{Binding AssetName}" />
                <telerikGridView:GridViewDataColumn Header="Process" DataMemberBinding="{Binding ProcessType}" />
                <telerikGridView:GridViewDataColumn Header="SiteId" DataMemberBinding="{Binding SiteId}" IsReadOnly="True" IsVisible="False" />
                <telerikGridView:GridViewDataColumn Header="OrderBy" DataMemberBinding="{Binding OrderByProcessType}" IsReadOnly="True" IsVisible="False" />
            </telerikGridView:RadGridView.Columns>
        </telerikGridView:RadGridView>
Tsvyatko
Telerik team
 answered on 02 Feb 2011
1 answer
114 views
Hello everybody,

Is is possible to drag and drop PinPoints in the map?

Thank you,
Esther
Andrey
Telerik team
 answered on 02 Feb 2011
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?