Telerik Forums
UI for WPF Forum
3 answers
194 views
Hi,

I have a myRadGridView binded to a QueryableEntityCollectionView<tableName> property. All worked perfect.
But when I create a Task to fill that property (that was binded to my RadGridView) it appears a messaje saying:

Ocurrió System.InvalidOperationException
  HResult=-2146233079
  Message=El subproceso que realiza la llamada no puede obtener acceso a este objeto porque el propietario es otro subproceso.
  Source=WindowsBase
  StackTrace:
       en System.Windows.DependencyObject.GetValue(DependencyProperty dp)
       en Telerik.Windows.Data.SortDescriptor.get_Member() en c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Data\Sorting\SortDescriptor.cs:línea 22
  InnerException: 


I'm using a MVVM pattern.
The definition of my property binded to my RadGridView is:
private QueryableEntityCollectionView<PROTOCOL> protocolsView;
public QueryableEntityCollectionView<PROTOCOL> ProtocolsView
{
    get { return protocolsView; }
    set
    {
        protocolsView = value;
        RaisePropertyChanged("ProtocolsView");
    }
}


The code I have written in the ViewModel is:
Task.Factory.StartNew(new Action(() =>
            {
 
                DbContext dbContext = new wafintellectEntities(Global.Configuracion.CadenaConexionBDEntity); // connection to BD
                ObjectContext objectContext = ((System.Data.Entity.Infrastructure.IObjectContextAdapter)dbContext).ObjectContext;
                bool error = false;
                try
                {
                    //ProtocolsView = new QueryableEntityCollectionView<PROTOCOL>(objectContext, "PROTOCOLs");
                    results = new QueryableEntityCollectionView<PROTOCOL>(objectContext, "PROTOCOLs");
                }
                catch (Exception e)
                {
                    error = true;
                    MessageBox.Show("Cadena de conexión errónea. Por favor, configure la conexión con la BD correctamente." + System.Environment.NewLine + e.Message, "Imposible cargar datos", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
                }
                mi.Invoke(new Action(() =>
                {
                    if (!error)
                    {
                        ProtocolsView = results; // "ProtocolsView " is the property binded to my RadGridView
                    }
                }));
}));

The RadGridView is:
<telerik:RadGridView
    x:Name="grdProtocol"
    ItemsSource="{Binding ProtocolsView}"
    AutoGenerateColumns="False"
    SelectionUnit="FullRow"
    GridLinesVisibility="Horizontal"
    CanUserDeleteRows="False"
    CanUserInsertRows="False"
    CanUserFreezeColumns="False"
    RowIndicatorVisibility="Collapsed"
    IsReadOnly="True"
    ShowGroupPanel="False" Grid.ColumnSpan="2">
</telerik:RadGridView>

In the ViewModel, if I change the definition of the property and the code of the Task for the next one code, it works:
private IQueryable protocolsView;
        public IQueryable ProtocolsView
        {
            get { return protocolsView; }
            set
            {
                protocolsView = value;
                RaisePropertyChanged("ProtocolsView");
            }
        }
Task.Factory.StartNew(new Action(() =>
            {
                try
                {
                    wafintellectEntities myEntity = new wafintellectEntities(Global.Configuracion.CadenaConexionBDEntity); // connection to BD
                    ProtocolsView = myEntity.PROTOCOLs; // get the entire data of the table PROTOCOLs
                }
                catch
                {
                    MessageBox.Show("Error al abrir BD...");
                }
            }));



So, my question is:
How can I use QueryableEntityCollectionView<tableName> in a Task?

Thanks.

Sonia.
Dimitrina
Telerik team
 answered on 23 Sep 2013
3 answers
423 views
Hello ,

i am using radtabcontrol , in which when initially control is loaded everything works fine, but if i change the datacontext when control is still active , the data is not loaded with in the tabs , but tabs are visible, once i click on the tab data is visible.

following screenshots may help 
1. initial load when first time data is loaded.(intialload
2.when datacontext is changed(datacontextchanged)
3. when i click on any tab once data is loaded(afterclickingatab)

i want my ui to look like 3 when datacontext change happens , do you have any idea why this is happening ?

my xaml look like this -
<Window x:Class="TabPanelInstanceValidator.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        xmlns:tabPanelInstanceValidator="clr-namespace:TabPanelInstanceValidator"
        Title="MainWindow" Height="350" Width="525">
 
    <telerik:RadTabControl ItemsSource="{Binding}" DisplayMemberPath="header"  >
        <telerik:RadTabControl.ContentTemplate>
            <DataTemplate>
                <telerik:RadDocking>
                    <telerik:RadDocking.DocumentHost>
                        <telerik:RadGridView  AutoGenerateColumns="False" ShowGroupPanel="False"  ItemsSource="{Binding Elements}"   >
                          <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Path}"  Width="*" Header="elements"></telerik:GridViewDataColumn>
                            </telerik:RadGridView.Columns>
                            <telerik:RadGridView.RowStyle>
                                <Style TargetType="telerik:GridViewRow">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate>
                                            <telerik:RadExpander ExpandDirection="Down" Name="check"  Header="{Binding Path}">
                                                <GroupBox>
                                                    <GroupBox.Header>
                                                        <CheckBox>ShowAll</CheckBox>
                                                    </GroupBox.Header>
                                                        <tabPanelInstanceValidator:CustomRadGridView  AutoGenerateColumns="False"  AssignableColumns="{Binding}"  DataContext="{Binding FeedData}"  RowIndicatorVisibility="Hidden" >
                                                    </tabPanelInstanceValidator:CustomRadGridView>
                                                </GroupBox>
                                                </telerik:RadExpander>
                                            
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </telerik:RadGridView.RowStyle>
 
                          
                        </telerik:RadGridView>
                    </telerik:RadDocking.DocumentHost>
                    <telerik:RadSplitContainer InitialPosition="DockedLeft">
                        <telerik:RadPaneGroup>
                            <telerik:RadPane IsPinned="False" CanFloat="False" Header="Legend">
                                <StackPanel>
                                <Button Click="ButtonBase_OnClick">changedatacontext</Button>
                                <TextBlock>test</TextBlock>
                                </StackPanel>
                            </telerik:RadPane>
                        </telerik:RadPaneGroup>
                    </telerik:RadSplitContainer>
 
                </telerik:RadDocking>
            </DataTemplate>
        </telerik:RadTabControl.ContentTemplate>
 
    </telerik:RadTabControl>
 
 
</Window>

the code behind for same is -
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Input;
 
namespace TabPanelInstanceValidator
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            List<Rules> abc = new List<Rules>();
            abc.Add(new Rules("interface Rule")
            {
                Elements = new List<ElementRule>() { new ElementRule("Motor|Control")
                                                         {
                                                            FeedData = new List<RuleCollect>()
                                                         {
                                                            new RuleCollect()
                                                                {
                                                                    element = "sample",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        },
                                                                                        new Rule()
                                                                                        {
                                                                                            name = "RuleTest2",
                                                                                            status = "Optional"
                                                                                        }
                                                                                }
                                                                },
                                                              new RuleCollect()
                                                                {
                                                                    element = "sample1",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        },
                                                                                         new Rule()
                                                                                        {
                                                                                            name = "RuleTest2",
                                                                                            status = "Required"
                                                                                        }
                                                                                }
                                                                },
                                                         }}
                                                                                          ,new ElementRule("Motor|SuperVision") {
                                                            FeedData = new List<RuleCollect>()
                                                         {
                                                            new RuleCollect()
                                                                {
                                                                    element = "sample",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        },
                                                                                        new Rule()
                                                                                        {
                                                                                            name = "RuleTest2",
                                                                                            status = "Optional"
                                                                                        }
                                                                                }
                                                                },
                                                              new RuleCollect()
                                                                {
                                                                    element = "sample1",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        }
                                                                                }
                                                                },
                                                         }}}
            });
            abc.Add(new Rules("element rules")
            {
                Elements = new List<ElementRule>() { new ElementRule("Motor|sbdk1")
                                                                                          {
                                                                                               FeedData = new List<RuleCollect>()
                                                         {
                                                            new RuleCollect()
                                                                {
                                                                    element = "sample",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        },
                                                                                        new Rule()
                                                                                        {
                                                                                            name = "RuleTest2",
                                                                                            status = "Optional"
                                                                                        }
                                                                                }
                                                                },
                                                              new RuleCollect()
                                                                {
                                                                    element = "sample1",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        },
                                                                                         new Rule()
                                                                                        {
                                                                                            name = "RuleTest2",
                                                                                            status = "Required"
                                                                                        }
                                                                                }
                                                                },
                                                         }}, new ElementRule("Motor|sbdk2")
                                                                 {
                                                                    FeedData = new List<RuleCollect>()
                                                         {
                                                            new RuleCollect()
                                                                {
                                                                    element = "sample",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        },
                                                                                        new Rule()
                                                                                        {
                                                                                            name = "RuleTest2",
                                                                                            status = "Optional"
                                                                                        },
                                                                                        new Rule()
                                                                                            {
                                                                                                name = "RuleTest3",
                                                                                                status = "Prohibited"
                                                                                            }
                                                                                }
                                                                },
                                                              new RuleCollect()
                                                                {
                                                                    element = "sample1",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        },
                                                                                         new Rule()
                                                                                        {
                                                                                            name = "RuleTest2",
                                                                                            status = "Required"
                                                                                        }, new Rule()
                                                                                            {
                                                                                                name = "RuleTest3",
                                                                                                status = "Prohibited"
                                                                                            }
                                                                                }
                                                                },
                                                         }  
                                                                 } }
            });
            this.DataContext = abc;
        }
 
      
 
        private void UIElement_OnMouseEnter(object sender, MouseEventArgs e)
        {
            throw new NotImplementedException();
        }
 
        private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
        {
            List<Rules> abc = new List<Rules>();
            abc.Add(new Rules("interface Rule")
            {
                Elements = new List<ElementRule>() { new ElementRule("Motor|Control")
                                                         {
                                                            FeedData = new List<RuleCollect>()
                                                         {
                                                            new RuleCollect()
                                                                {
                                                                    element = "sample",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        },
                                                                                        new Rule()
                                                                                        {
                                                                                            name = "RuleTest2",
                                                                                            status = "Optional"
                                                                                        }
                                                                                }
                                                                },
                                                              new RuleCollect()
                                                                {
                                                                    element = "sample1",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        },
                                                                                         new Rule()
                                                                                        {
                                                                                            name = "RuleTest2",
                                                                                            status = "Required"
                                                                                        }
                                                                                }
                                                                },
                                                         }}
                                                                                          ,new ElementRule("Motor|SuperVision") {
                                                            FeedData = new List<RuleCollect>()
                                                         {
                                                            new RuleCollect()
                                                                {
                                                                    element = "sample",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        },
                                                                                        new Rule()
                                                                                        {
                                                                                            name = "RuleTest2",
                                                                                            status = "Optional"
                                                                                        }
                                                                                }
                                                                },
                                                              new RuleCollect()
                                                                {
                                                                    element = "sample1",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        }
                                                                                }
                                                                },
                                                         }}}
            });
            abc.Add(new Rules("testrule")
                        {
                            Elements = new List<ElementRule>() { new ElementRule("check")}
                        });
          
            this.DataContext = abc;
            
           // aa.SelectedIndex = 1;
 
        } 
    }
}
Pavel R. Pavlov
Telerik team
 answered on 23 Sep 2013
1 answer
188 views
I wanted to add a column chooser functionality in the gridview. I have done it in past but had a question that can it be acheived by just adding a header cell from codebehind or by any other way. I have done it by using the row indicator column and using the space on the header to open choose column window, which i have attached a image of that. 

Question here is that is there a way to hide the row indicator column and just use the extra header on top/ or code behind way to add a header cell which handles this functionality. 


Thanks,

Dimitrina
Telerik team
 answered on 23 Sep 2013
3 answers
181 views
Hello,

I have found that even though i set the correct (german) culture on currentthread and CurrentUIThread, RadGanttView still uses a 12 hour format fo display times when zoomed in. I'd like to change this to a corresponding 24-hour format, that is used the default for this culture.

I would expect the ganttview to respect certain culture settings like this.

How can i achieve this?

Thanks
Vladi
Telerik team
 answered on 23 Sep 2013
5 answers
272 views
What would be involved to use the diagram control in a lightswitch application (if at all possible)?
Pavel R. Pavlov
Telerik team
 answered on 23 Sep 2013
2 answers
191 views

N.B. Framework 4.5

// first in Application  App.cs set at runtime theme windows8
protected override void OnStartup(StartupEventArgs e)
{           
    StyleManager.ApplicationTheme = new Windows8Theme();                   
}

// Then create two VIEW

// First is MASTER_VIEW
// ADD XAML
  <telerik:RadTabControl Grid.Row="0" >

            <telerik:RadTabItem DropDownContent="Trend Import" Header="DETAIL" >
                <telerik:RadTabItem.Content>
                    <views:DETAIL_VIEW/>
                </telerik:RadTabItem.Content>
            </telerik:RadTabItem>

</telerik:RadTabControl>

// ADD SECOND XAML -> DETAIL_VIEW
<Grid>

   <GroupBox Header="tyy tyy" >
           <TextBlock Text="Settings"/> 
    </GroupBox>
 </Grid>
      
Build and run WPF APPLICATION

TextBlock is not visible. Cannot see content(Text) of any TextBlock controls?
I use default style at all.

Workaround:
Remove: OnStartup(StartupEventArgs e) function, stay at default theme.
You will see all textblock controls again.

Additional info: This bug depends and others controls like GroupBox and others.

Framework 4.5
VS2012

Telerik v. 2013.2.611.45 (For framework 4.5)

This is styles that I use. In comment is second workaround.

                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  
    <ControlTemplate x:Key="TextBoxErrorTemplate">
        <DockPanel LastChildFill="True" >
            <Border BorderBrush="Red" BorderThickness="1" >
                <AdornedElementPlaceholder x:Name="Holder"  />
            </Border>
            <Label  Foreground="White" Content="{Binding ElementName=Holder, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}" BorderThickness="1" BorderBrush="White" Background="Red" UseLayoutRounding="True"  />
        </DockPanel>
    </ControlTemplate>
  
      
    <Style TargetType="Button"
            <Style.Triggers>
                <Trigger Property="Validation.HasError" Value="true">
                    <Setter Property="IsEnabled" Value="False"/>                                        
                </Trigger>
                <Trigger Property="Validation.HasError" Value="false">
                    <Setter Property="IsEnabled" Value="True"/>                     
                </Trigger>                
            </Style.Triggers>
    </Style>
  
    <Style x:Key="LinkButton" TargetType="Button">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <TextBlock TextDecorations="Underline">
                    <ContentPresenter />
                    </TextBlock>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground" Value="Blue" />
        <Setter Property="Cursor" Value="Hand" />
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Foreground" Value="Red" />
            </Trigger>
        </Style.Triggers>
    </Style>
  
 <!--
    <Style TargetType="TextBlock">
        <Setter Property="Foreground" Value="#FF151515" />       
    </Style>
  
    <Style TargetType="GroupBox">
        <Setter Property="Foreground" Value="#FF151515" />
    </Style>
-->
      
</ResourceDictionary>
     


                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
  
    
  
    <Style x:Key="LinkButtonStyle" TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <TextBlock TextDecorations="Underline">
                        <ContentPresenter />
                    </TextBlock>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Foreground" Value="Blue" />
        <Setter Property="Cursor" Value="Hand" />
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Foreground" Value="Red" />
            </Trigger>
        </Style.Triggers>
    </Style>
  
</ResourceDictionary>
kity
Top achievements
Rank 2
 answered on 23 Sep 2013
1 answer
179 views
Hi

I have noticed some huge performance difference when the StyleManager is enabled - default value - or when disabled.

When enabled every telerik control will reset template in OnInitialized method:


One window with 6 RadComboBox elements: ResetTheme takes 585 ms ..

How can I specify application wide theme -windows8- and disable the stylemanager:
Telerik.Windows.Controls.StyleManager.IsEnabled = False

Thanks
Rosen Vladimirov
Telerik team
 answered on 23 Sep 2013
2 answers
195 views
Hello,

I'm trying to implement drag&drop in a radgridview.

I'm using this how to :
http://www.telerik.com/help/wpf/dragdropmanager-howto-draganddrop-within-radgridview.html

Everything is ok, but as soon as I add rowstyle code block, my rows are displayed blank (scrollbar remains visible).

This code is ok :

<telerik:RadGridView ItemsSource="{Binding Object.Details.Attributes}"
                        AutoGenerateColumns="True"
                        ScrollViewer.CanContentScroll="True"
                        ScrollViewer.HorizontalScrollBarVisibility="Visible"
                        ScrollViewer.VerticalScrollBarVisibility="Visible"
                        CanUserDeleteRows="False"
                        CanUserInsertRows="False"
                        CanUserReorderColumns="False"
                        CanUserResizeRows="False"
                        CanUserFreezeColumns="False"
                        CanUserSortColumns="False"
                        IsFilteringAllowed="False"
                        RowIndicatorVisibility="Collapsed"
                        ShowGroupPanel="False"
                        DataLoadMode="Asynchronous"
                        IsReadOnly="{Binding IsEditing, Converter={StaticResource InvertBoolConverter}}"
                        EnableRowVirtualization="True"
                        FrozenColumnCount="1"
                        AllowDrop="True"
                        behaviors:RowReorderBehavior.IsEnabled="True"
                        BeginningEdit="Attributes_RadGridView_BeginningEdit"
                     >
 
    <telerik:RadGridView.Resources>
        <DataTemplate x:Key="DraggedItemTemplate">
            <StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Dragging:" />
                    <TextBlock Text="{Binding CurrentDraggedItem}"
                  FontWeight="Bold" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding CurrentDropPosition}" FontWeight="Bold" MinWidth="45" />
                    <TextBlock Text=", (" Foreground="Gray" />
                    <TextBlock Text="{Binding CurrentDraggedOverItem}" />
                    <TextBlock Text=")"
                  Foreground="Gray" />
                </StackPanel>
            </StackPanel>
        </DataTemplate>
    </telerik:RadGridView.Resources>
     
 
 
 
    <telerik:RadGridView.Columns>
 
        <telerik:GridViewDataColumn Header="Attribute" DataMemberBinding="{Binding Attribute.TechName}" IsReadOnly="True"/>
        .......
        <telerik:GridViewDataColumn Header="Length" DataMemberBinding="{Binding Attribute.Details.LengthInternal}" IsReadOnly="True"/>
    </telerik:RadGridView.Columns>
     
</telerik:RadGridView>

But with this code, rows are displayed blank (only headers and scrollbars are visibles) :

<telerik:RadGridView ItemsSource="{Binding Object.Details.Attributes}"
                        AutoGenerateColumns="True"
                        ScrollViewer.CanContentScroll="True"
                        ScrollViewer.HorizontalScrollBarVisibility="Visible"
                        ScrollViewer.VerticalScrollBarVisibility="Visible"
                        CanUserDeleteRows="False"
                        CanUserInsertRows="False"
                        CanUserReorderColumns="False"
                        CanUserResizeRows="False"
                        CanUserFreezeColumns="False"
                        CanUserSortColumns="False"
                        IsFilteringAllowed="False"
                        RowIndicatorVisibility="Collapsed"
                      
                        ShowGroupPanel="False"
                        DataLoadMode="Asynchronous"
                        IsReadOnly="{Binding IsEditing, Converter={StaticResource InvertBoolConverter}}"
                        EnableRowVirtualization="True"
                        FrozenColumnCount="1"
                        AllowDrop="True"
                        behaviors:RowReorderBehavior.IsEnabled="True"
                        BeginningEdit="Attributes_RadGridView_BeginningEdit"
                     >
 
    <telerik:RadGridView.Resources>
        <DataTemplate x:Key="DraggedItemTemplate">
            <StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Dragging:" />
                    <TextBlock Text="{Binding CurrentDraggedItem}"
                  FontWeight="Bold" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding CurrentDropPosition}" FontWeight="Bold" MinWidth="45" />
                    <TextBlock Text=", (" Foreground="Gray" />
                    <TextBlock Text="{Binding CurrentDraggedOverItem}" />
                    <TextBlock Text=")"
                  Foreground="Gray" />
                </StackPanel>
            </StackPanel>
        </DataTemplate>
    </telerik:RadGridView.Resources>
     
 
 
 
    <telerik:RadGridView.Columns>
 
        <telerik:GridViewDataColumn Header="Attribute" DataMemberBinding="{Binding Attribute.TechName}" IsReadOnly="True"/>
           .....
        <telerik:GridViewDataColumn Header="Length" DataMemberBinding="{Binding Attribute.Details.LengthInternal}" IsReadOnly="True"/>
    </telerik:RadGridView.Columns>
 
    <telerik:RadGridView.RowStyle>
        <Style TargetType="telerik:GridViewRow">
            <Setter Property="Background" Value="Red"/>
            <Setter Property="telerik:DragDropManager.AllowDrag" Value="True" />
        </Style>
    </telerik:RadGridView.RowStyle>
 
</telerik:RadGridView>



Do you know what is the root cause ?

Thanks in advance,

Laurent
Dimitrina
Telerik team
 answered on 23 Sep 2013
7 answers
289 views
Hi,
I'm using MvvM and the RadCartesianChart.
I bind the series to a list of business objects of that kind:

public class MainViewModel
{
    public ObservableCollection<DataObject> Data{get;set;}
    ...
}
 
 
public class DataObject
{
    public string Name { get; set; }
    public ObservableCollection<DataPair> Data { get; set; }
}
  
public class DataPair
{
    public DateTime Time { get; set; }
    public double Value { get; set; }
}

In my View:

<telerik:RadCartesianChart.SeriesProvider>
    <telerik:ChartSeriesProvider Source="{Binding Data}">
        <telerik:ChartSeriesProvider.SeriesDescriptors>
            <telerik:CategoricalSeriesDescriptor ItemsSourcePath="Data" ValuePath="Value" CategoryPath="Time">
                <telerik:CategoricalSeriesDescriptor.Style>
                    <Style TargetType="telerik:LineSeries">
                        <Setter Property="RenderMode" Value="Light"/>
                    </Style>
                </telerik:CategoricalSeriesDescriptor.Style>
            </telerik:CategoricalSeriesDescriptor>
        </telerik:ChartSeriesProvider.SeriesDescriptors>
    </telerik:ChartSeriesProvider>
</telerik:RadCartesianChart.SeriesProvider>

How is it possible to change the color of each series at runtime.
If I put a Setter on the Stroke Property I got an exception: NullReferenceException


Regards Markus
Klemens
Top achievements
Rank 1
 answered on 23 Sep 2013
2 answers
289 views
I would like to know if there is some sample code to create a RadChart programmatically.

I only have this code in the xaml file:

<telerik:RadChart Content="RadChart" HorizontalAlignment="Left" Margin="10,455,0,10" Grid.Row="1" Width="791"/>

And I would like to create the series, configure the axes, bind the chart to a datatable where I have the data that I want to show, in the cs file.

Thanks,

Alberto
Alberto
Top achievements
Rank 1
 answered on 20 Sep 2013
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
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
InlineAIAssistant
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?