Telerik Forums
UI for WPF Forum
1 answer
145 views
I'm creating a nested grid view that is three levels deep. I have a parent and a child grid with the child grid containing a tab control with two additional grids. The grids and everything load properly, however the buttons in the tab items are never being displayed (Add Hedging Default and Add Tank Bottom).
Do you see anything wrong with the XAML that would prevent them from being displayed? I've removed the stack panel, tried other buttons, set the size explicitly, etc without any change. 

At this point I'm at a loss of where to go from here.

Thank you


<
Grid DataContext="{StaticResource VmTerminalConfiguration}" Name="rootWindow" >
     <Grid.Resources>
         <DataTemplate x:Key="ChildRowDetailsTemplate">
 
             <telerik:RadTabControl x:Name="tabControl" telerik:TouchManager.IsTouchHitTestVisible="False">
 
                 <telerik:RadTabItem Header="Hedging Defaults" Name="hedgingDefaultsTabItem">
                     <Grid x:Name="LayoutWhite" Background="White">
                         <Grid.RowDefinitions>
                             <RowDefinition Height="Auto" />
                             <RowDefinition Height="*" />
                         </Grid.RowDefinitions>
 
                         <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="0" Margin="0,5,0,5">
                             <telerik:RadButton Content="Add New Hedging Default" Click="AddHedgingDefaultButton_Click" Width="150" Margin="0,0,5,0" />
                         </StackPanel>
 
 
                         <telerik:RadGridView Grid.Row="1" Name="hedgingDefaultRadGridView" GroupRenderMode="Flat"
                          ItemsSource="{Binding TerminalConfigurationHedgingDefaultVMs}"
                          Foreground="Black" Height="250" RowIndicatorVisibility="Collapsed"
                          AutoGenerateColumns="False" CanUserFreezeColumns="False" BorderThickness="0"
                          CanUserResizeColumns="False" ShowGroupPanel="False" BorderBrush="{x:Null}" Margin="0"
                          EditTriggers="CellClick" CellEditEnded="CellEditEnded">
                             <telerik:RadGridView.Resources>
                                 <Style x:Key="GridViewToggleButtonColumnStyle" TargetType="telerik:GridViewCell">
                                     <Setter Property="Padding" Value="0,0,0,0" />
                                 </Style>
                             </telerik:RadGridView.Resources>
                             <telerik:RadGridView.Columns>
 
                                 <telerik:GridViewComboBoxColumn Header="Product" DataMemberBinding="{Binding ParentCommodityID}"
                                             SelectedValueMemberPath="CommodityID" DisplayMemberPath="CommodityName" ItemsSource="{Binding AllParentCommodities,ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" />
                                 <telerik:GridViewComboBoxColumn Name="cmbReceiptHedgingDefault" Header="Receipt" DataMemberBinding="{Binding ReceiptHedgingDefault, Mode=TwoWay, ValidatesOnDataErrors=True}"
                                                                             ItemsSource="{Binding DefaultOptions}" />
                                 <telerik:GridViewComboBoxColumn Name="cmbOtherHedgingDefault" Header="Other" DataMemberBinding="{Binding OtherHedgingDefault, Mode=TwoWay, ValidatesOnDataErrors=True}"
                                                                             ItemsSource="{Binding DefaultOptions}" />
                                 <telerik:GridViewComboBoxColumn Name="cmbScheduleHedgingDefault" Header="Schedule" DataMemberBinding="{Binding ScheduleHedgingDefault, Mode=TwoWay, ValidatesOnDataErrors=True}"
                                                                             ItemsSource="{Binding DefaultOptions}" />
                                 <telerik:GridViewDataColumn Name="dpHedgingDefaultEffectiveDate" Header="Effective Date" DataMemberBinding="{Binding EffectiveDate, StringFormat=d, ValidatesOnDataErrors=True}" Width="150" />
                             </telerik:RadGridView.Columns>
 
 
                         </telerik:RadGridView>
                     </Grid>
                 </telerik:RadTabItem>
                 <telerik:RadTabItem Header="Tank Bottoms" Name="tankBottomsTabItem">
                     <Grid Background="White">
                         <Grid.RowDefinitions>
                             <RowDefinition Height="Auto" />
                             <RowDefinition Height="*" />
                         </Grid.RowDefinitions>
                         <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="0" Margin="0,5,0,5">
                             <telerik:RadButton Content="Add New Tank Bottom" Click="AddTankBottomButton_Click" Width="150" Margin="0,0,5,0" />
                         </StackPanel>
                         <telerik:RadGridView Grid.Row="1" x:Name="tankBottomRadGridView" GroupRenderMode="Flat"
                          ItemsSource="{Binding TerminalConfigurationTankBottomVMs}"
                          Foreground="Black" Height="250" RowIndicatorVisibility="Collapsed"
                          AutoGenerateColumns="False" CanUserFreezeColumns="False" BorderThickness="0"
                          CanUserResizeColumns="False" ShowGroupPanel="False" BorderBrush="{x:Null}" Margin="0"
                                              EditTriggers="CellClick" CellEditEnded="CellEditEnded">
                             <telerik:RadGridView.Resources>
                                 <Style x:Key="GridViewToggleButtonColumnStyle" TargetType="telerik:GridViewCell">
                                     <Setter Property="Padding" Value="0,0,0,0" />
                                 </Style>
                             </telerik:RadGridView.Resources>
                             <telerik:RadGridView.Columns>
                                 <telerik:GridViewComboBoxColumn Header="Product" DataMemberBinding="{Binding ParentCommodityID}"
                                             SelectedValueMemberPath="CommodityID" DisplayMemberPath="CommodityName" ItemsSource="{Binding AllParentCommodities,ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" />
                                 <telerik:GridViewDataColumn Name="txtTankBottom" Header="Tank Bottom" DataMemberBinding="{Binding Bottom,ValidatesOnDataErrors=True}" Width="150" />
                                 <telerik:GridViewDataColumn Name="dpTankBottomEffectiveDate" Header="Effective Date" DataMemberBinding="{Binding EffectiveDate, StringFormat=d, ValidatesOnDataErrors=True}" Width="150" />
                             </telerik:RadGridView.Columns>
                         </telerik:RadGridView>
                     </Grid>
                     <!--<local:TerminalInventoryGridCommentView />-->
                 </telerik:RadTabItem>
             </telerik:RadTabControl>
         </DataTemplate>
         <DataTemplate x:Key="RowDetailsTemplate">
             <Grid>
             
                 <Grid.RowDefinitions>
                     <RowDefinition Height="Auto" />
                     <RowDefinition Height="*" />
                 </Grid.RowDefinitions>
                 <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="0" Margin="0,5,0,5">
                     <telerik:RadButton Content="Add New Terminal" Click="AddTerminalButton_Click" Width="150" Margin="0,0,5,0" />    
                 </StackPanel>
 
                 <telerik:RadGridView Grid.Row="1"  HorizontalAlignment="Stretch" Name="terminalGridView" VerticalAlignment="Stretch"
                          ItemsSource="{Binding TerminalConfigurationTerminalVMs}"
                          Margin="0" GroupRenderMode="Flat" RowIndicatorVisibility="Collapsed" IsReadOnly="False" AutoGenerateColumns="False"
                          CanUserFreezeColumns="False" CanUserResizeColumns="False" ColumnWidth="*" RowDetailsTemplate="{StaticResource ChildRowDetailsTemplate}"
                          AllowDrop="True" IsFilteringAllowed="False" CanUserReorderColumns="True" CanUserDeleteRows="False" CanUserSortColumns="False" CanUserSortGroups="False"
                          ShowGroupPanel="False" EditTriggers="CellClick" CellEditEnded="CellEditEnded">
             
                     <telerik:RadGridView.Columns>
                         <telerik:GridViewToggleRowDetailsColumn/>
                         <telerik:GridViewComboBoxColumn Name="cmbTerminalName" Header="Name" DataMemberBinding="{Binding TerminalID}"
                                             SelectedValueMemberPath="TerminalID" DisplayMemberPath="TerminalName" ItemsSource="{Binding AllTerminals, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" Width="150"/>
                         <telerik:GridViewDataColumn Name="dpTerminalStartDate" Header="Start Date" DataMemberBinding="{Binding StartDate, StringFormat=d, ValidatesOnDataErrors=True, Mode=TwoWay}" Width="150" />
                         <telerik:GridViewDataColumn Name="dpTerminalEndDate" Header="End Date" DataMemberBinding="{Binding EndDate, StringFormat=d, ValidatesOnDataErrors=True, Mode=TwoWay}" Width="150" />
 
 
                     </telerik:RadGridView.Columns>
                 </telerik:RadGridView>
             </Grid>
         </DataTemplate>
     </Grid.Resources>
      
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="Auto" />
             <RowDefinition Height="*" />
         </Grid.RowDefinitions>
 
         <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="0" Margin="0,5,0,5">
             <telerik:RadButton Content="Add New Delivery Area" Click="AddDeliveryAreaButton_Click" Width="150" Margin="0,0,5,0" />
             <telerik:RadButton Content="Save Changes" Click="SaveChangesButton_Click" Width="150" Margin="0,0,5,0" />
         </StackPanel>
 
         <telerik:RadGridView Grid.Row="1"  HorizontalAlignment="Stretch" Name="parentGridView" VerticalAlignment="Stretch"
                          ItemsSource="{Binding TerminalConfigurationDeliveryAreaVMs}"
                          Margin="0" GroupRenderMode="Flat" RowIndicatorVisibility="Collapsed" IsReadOnly="False" AutoGenerateColumns="False"
                          CanUserFreezeColumns="False" CanUserResizeColumns="False" ColumnWidth="*" RowDetailsTemplate="{StaticResource RowDetailsTemplate}"
                          AllowDrop="True" IsFilteringAllowed="False" CanUserReorderColumns="True" CanUserDeleteRows="False" CanUserSortColumns="False" CanUserSortGroups="False"
                          ShowGroupPanel="False" EditTriggers="CellClick" CellEditEnded="CellEditEnded">
 
             <telerik:RadGridView.Columns>
                 <telerik:GridViewToggleRowDetailsColumn/>
                 <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding DeliveryAreaName}" />
                 <telerik:GridViewComboBoxColumn Name="cmbInventoryRegion" Header="Region" DataMemberBinding="{Binding InventoryRegion,Mode=TwoWay, ValidatesOnDataErrors=True}"
                                             ItemsSource="{Binding AllInventoryRegions}" />
                 <telerik:GridViewCheckBoxColumn Name="cbInactive" Header="Inactive" DataMemberBinding="{Binding Inactive}" />
 
             </telerik:RadGridView.Columns>
 
         </telerik:RadGridView>
 
     </Grid>
 
 </Grid>
Dimitrina
Telerik team
 answered on 07 Aug 2013
1 answer
145 views
Hi,

I've read at documentation and at several forum entries that RadTransitionControl could be used as a Prism region because it inherits form ContentControl.

However, I'm trying to do this with no success. Here is my code:
<telerik:RadTransitionControl Grid.Column="3" Grid.Row="1" prism:RegionManager.RegionName="{x:Static common:RegionNames.MainRegion}">
                <telerik:RadTransitionControl.Transition>
                    <telerik:SlideAndZoomTransition/>
                </telerik:RadTransitionControl.Transition>
            </telerik:RadTransitionControl>
When calling RegionManager.RequestNavigate(RegionNames.MainRegion, myView) nothing appears at MainRegion (changing RadTransitionControl  by ContentControl it works as expected)

Any idea?

Thanks
George
Telerik team
 answered on 07 Aug 2013
2 answers
218 views
I have a need to support the dragging of images (.JPG files) from Windows Explorer and dropping them onto a TileView (creating a new tile with that image).  I've seen examples of dragging and dropping items originating in a Telerik control (ie, a TreeView or ListBox) and dropping them to a TileView, but nothing where the source originates outside the application containing the TileView control.  I've set the TileView's OnDrop property and have a OnDrop handler, but the handler never gets invoked when the image is dropped on the TileView.  Any help would be greatly appreciated.

Kevin
Top achievements
Rank 1
 answered on 06 Aug 2013
2 answers
150 views
Hi,

I tried to work with bound Properties on ConnectorShapes.
This works fine - as Long as I do not clear the InternalItems / InternalLinks in the Graph source.

First the Style (part of it)
<Style TargetType="telerik:RadDiagramConnection" >
        <!---->
        <Setter Property="Visibility" Value="{Binding Visibility, Mode=TwoWay}" />
        <!---->

Now my (simple) classes:
(forget about INPBase - it's just an implementation of INotifyPropertyChanged
The Node:
public class Item : INPBase {
        #region Content
        private string _Content;
        public string Content {
            get { return _Content; }
            set { Set(ref _Content, value); }
        }
        #endregion
    }


The Link:
public class Link : INPBase, ILink<Item> {
    public Visibility Visibility { get; set; }
    public Item Source { get; set; }
    public Item Target { get; set; }
 
    object ILink.Source {
        get { return ((object)Source); }
        set { if (!((object)Source).Equals(value)) { Source = value as Item; } }
    }
    object ILink.Target {
        get { return ((object)Target); }
        set { if (!((object)Target).Equals(value)) { Target = value as Item; } }
    }
    public Link() { Visibility = Visibility.Visible; }
}


The Tree:
public class TestTree : INPBase, IGraphSource {
        public ObservableCollection<Item> InternalItems { get; private set; }
        public ObservableCollection<Link> InternalLinks { get; private set; }
        public Item RootNode { get; private set; }
        public System.Collections.IEnumerable Items {           get { return (InternalItems); }     }
        public IEnumerable<ILink> Links {           get { return(InternalLinks); }      }
 
        public TestTree() {
            InternalItems = new ObservableCollection<Item>();
            InternalLinks = new ObservableCollection<Link>();
            BuildTree();
        }
        private void BuildTree() {
            RootNode = new Item() { Content = "One" };
            Item iTwo = new Item() { Content = "Two" };
            Item iThree = new Item() { Content = "Three" };
            Item iFour = new Item() { Content = "Four" };
            InternalItems.Add(RootNode);
            InternalItems.Add(iTwo);
            InternalItems.Add(iThree);
            InternalItems.Add(iFour);
            InternalLinks.Add(new Link() { Target = RootNode, Source = iTwo });
            InternalLinks.Add(new Link() { Target = RootNode, Source = iThree });
            InternalLinks.Add(new Link() { Target = RootNode, Source = iFour });
        }
        public void RebuildTree() {
            InternalLinks.Clear();
            InternalItems.Clear();
            BuildTree();
        }
        public void AddNodeWithLink() {
            Item iNew = new Item() { Content = "I" + InternalItems.Count.ToString() };
            Item iSource = InternalItems.First();
            InternalItems.Add(iNew);
            InternalLinks.Add(new Link() { Target = iSource, Source = iNew });
        }
    }


Last not Least I have a "ViewModel" like this:
public class TestVM : INPBase {
    private TestTree _TestTree;
    public TestTree TestTree {
        get { return _TestTree; }
    }
    public TestVM() {
        _TestTree = new TestTree();
    }
    public void AddNode() {
        _TestTree.AddNodeWithLink();
    }
    public void Rebuild() {
        _TestTree.RebuildTree();
    }
 
}
(of course in real code things are handled via commands - but that doesn't matter)


Everything works fine - as long as I'm not resetting the tree.
After this I get the debug message:

System.Windows.Data Error: 40 : BindingExpression path error: 'Visibility' property not found on 'object' ''TestVM' (HashCode=61656587)'. BindingExpression:Path=Visibility; DataItem='TestVM' (HashCode=61656587); target element is 'RadDiagramConnection' (Name=''); target property is 'Visibility' (type 'Visibility')


So it seems as if clearing the collections move the datacontext "on step up".
My Binding is simple the UserControl (hosting the diagram) has an Instance of TestVM as DataContext and the Diagram is bound like this:
<Grid DataContext="{Binding}" x:Name="grdHolder">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Button Content="Add node" VerticalAlignment="Center" HorizontalAlignment="Left" Click="AddNode_Click" />
        <Button Content="Rebuild" VerticalAlignment="Center" HorizontalAlignment="Center" Click="Rebuild_Click" />
        <Button Content="Layout" VerticalAlignment="Center" HorizontalAlignment="Right" Click="Layout_Click" />
        <telerik:RadDiagram x:Name="dG" GraphSource="{Binding TestTree}" Grid.Row="1"/>
    </Grid>

Thank you
Manfred


ManniAT
Top achievements
Rank 2
 answered on 06 Aug 2013
1 answer
309 views
I'm using radtabcontrol and added another screen(pending screen) as grid in the radcontrolItem like this,

Radcontrol.xaml
<telerik:RadTabItem  >
                    <telerik:RadTabItem.Content>
                     
 
                            <Grid  Name="displaypending" >
                                <Grid.RowDefinitions>
 
                                    <RowDefinition Height="*" />
 
                                </Grid.RowDefinitions>
 
                            </Grid>
                    
                    </telerik:RadTabItem.Content>
                </telerik:RadTabItem>

Radcontrol.xaml.cs

if (displaypending != null)
              {
                  displaypending.Children.Clear();
                  Pending pending = new Pending();
                  displaypending.Children.Add(pending);
                  IsScanningAllowed = ApplicationVariables.IsScannerInitiated;
                }

RadtabItem Content Header will be changed based on button click of pending screen, but i can't able to get changed header immediately after the button click, i need to reload the screen manually to get the changed header. So how to get the changed header without manually reload.
Pavel R. Pavlov
Telerik team
 answered on 06 Aug 2013
1 answer
101 views

Hi,

I have a layout with RadTreeView docked to left using RadDocking and a RadTileView inside a DocumentHose. While I unpin the panel which is docked to left and don't move the mouse from pin button, the unpinned panel expands again but it is empty.

Please find my code below:

     <telerik:RadDocking Background="Transparent" BorderThickness="0" HorizontalAlignment="Left" >
            <telerik:RadDocking.DocumentHost>

                    <telerik:RadTileView x:Name="c_tileView" ColumnWidth="Auto" RowsCount="2"
                             RowHeight="Auto" MinimizedColumnWidth="450" MinimizedRowHeight="150"
                             IsItemsSizeInPercentages="True" PreservePositionWhenMaximized="true"
                             telerik:TileViewPanel.IsColumnsShrinkEnabled="True"
    telerik:TileViewPanel.IsRowsShrinkEnabled="True"
                             telerik:TileViewPanel.IsSizeBoundToPosition="True"
                             telerik:PersistenceManager.StorageId="tileView">

                        <telerik:RadTileViewItem RestoredHeight="30" MinimizedHeight="150" RestoredWidth="28" >
                            <Rectangle/>
                        </telerik:RadTileViewItem>

                        <telerik:RadTileViewItem RestoredHeight="25" MinimizedHeight="150" RestoredWidth="48" >
                            <Rectangle/>
                        </telerik:RadTileViewItem>

                        <telerik:RadTileViewItem RestoredHeight="50" MinimizedHeight="150" RestoredWidth="24" >
                            <Rectangle/>
                        </telerik:RadTileViewItem>                      
                    </telerik:RadTileView>

            </telerik:RadDocking.DocumentHost>
            <telerik:RadSplitContainer MaxWidth="300" telerik:DockingPanel.InitialSize="210,150" InitialPosition="DockedLeft">
                <telerik:RadPaneGroup>
                    <telerik:RadPane Header="Screen Models" CanUserClose="False"
            ContextMenuTemplate="{x:Null}"
            CanDockInDocumentHost="False" IsPinned="False">
                        <telerik:RadTreeView x:Name="c_treeView" Grid.Row="1" Margin="0"
              VerticalAlignment="Stretch" IsLineEnabled="True"
              ScrollViewer.HorizontalScrollBarVisibility="Auto"
              IsDragDropEnabled="False">
                            <telerik:RadTreeViewItem Header="Test A" IsExpanded="True">
                                <telerik:RadTreeViewItem Header="Model A"/>
                                <telerik:RadTreeViewItem Header="Model B"/>
                                <telerik:RadTreeViewItem Header="Model C"/>
                                <telerik:RadTreeViewItem Header="Model D"/>
                            </telerik:RadTreeViewItem>

                        </telerik:RadTreeView>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
          
        </telerik:RadDocking>

Kalin
Telerik team
 answered on 06 Aug 2013
1 answer
104 views
Hi,

I have a problem with a radWindow in our application in that it does not function correctly on Windows 8. The problem is that the window is displayed correctly but none of the bindings to the viewmodel (data context) work, however there are no binding errors in the output window. Also when you check the datacontext on the window it is set to the correct viewmodel its just as if the bindings are not working. The window contains a few listboxes and a radGridview and they do not display any data, but as stated no binding errors are reported. The strange thing is that the same window works perfectly on Windows 7/XP, also if you show the window from an existing modal radWindow it works as expected on Windows 8. The problem only occurs when the Window is displayed and only the main application shell window is visible which is a radRibbonWindow. I know its a bit of a long shot but has anyone got an idea on what may be causing this, with no errors or exceptions to go on its proving a real problem for us to fix?

Thanks
Vladi
Telerik team
 answered on 06 Aug 2013
2 answers
143 views
Hello

We trying to implement the master-detail WPF app to learn the capabilities of Telerik RadGridView.

It is a simple application which has RadGridView with the following markup:
<telerik:RadGridView ItemsSource="{Binding Persons}" SelectedItem="{Binding Selectedperson, Mode=TwoWay}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" AutoGenerateColumns="True" telerik:StyleManager.Theme="Windows7">
            <telerik:RadGridView.ChildTableDefinitions>
                <telerik:GridViewTableDefinition>
                </telerik:GridViewTableDefinition>
            </telerik:RadGridView.ChildTableDefinitions>
            <telerik:RadGridView.HierarchyChildTemplate>
                <DataTemplate>
                    <telerik:RadGridView
                            AutoGenerateColumns="True"
                            telerik:StyleManager.Theme="Windows7"
                            ItemsSource="{Binding Details}">
                    </telerik:RadGridView>
                </DataTemplate>
            </telerik:RadGridView.HierarchyChildTemplate>
        </telerik:RadGridView>
Under the hood is view model which is set to DataContext of the main windows where Telerik RadGridView is placed, as follows:
namespace MasterDetailViaDataTables
{
    public partial class MainWindow : Window
    {
 
        public MainWindow()
        {
            InitializeComponent();
            this.DataContext = new MainViewModel();
        }

Persons and Details are fields of view model which are ObservableCollection of appropriate instances.
PersonDetails.cs:
namespace MasterDetailViaDataTables
{
    public class PersonDetails : BindableBase
    {
        private int _PersonID;
        public int PersonID
        {
            get { return _PersonID; }
            set { this.SetProperty<int>(ref this._PersonID, value); }
        }
 
        private string address;
        public string Address
        {
            get { return address; }
            set { this.SetProperty<string>(ref this.address, value); }
        }
 
        private string _Description;
        public string Description
        {
            get { return _Description; }
            set { this.SetProperty<string>(ref this._Description, value); }
        }
 
        public static ObservableCollection<PersonDetails> GetDetails()
        {
            ObservableCollection<PersonDetails> details = new ObservableCollection<PersonDetails>();
            try
            {
                DataTable table = new DataTable("persondetail");
                DataColumn PersonID = new DataColumn("PersonID", typeof(System.Int64));
                DataColumn Address = new DataColumn("Address", typeof(System.String));
                DataColumn Description = new DataColumn("Description", typeof(System.String));
                table.Columns.Add(PersonID);
                table.Columns.Add(Address);
                table.Columns.Add(Description);
 
                for (int pID = 1; pID <= 5; pID++)
                {
                    for (int i = 0; i < 2; i++)
                    {
                        DataRow row = table.NewRow();
                        row["PersonID"] = pID;
                        row["Address"] = "Address" + (pID-1).ToString() + " - " + i.ToString();
                        row["Description"] = "Description" + (pID-1).ToString() + " - " + i.ToString();
                        table.Rows.Add(row);
                    }
                }
 
 
                details.Clear();
 
                for (int i = 0; i < table.Rows.Count; ++i)
                    details.Add(new PersonDetails
                    {
                        PersonID = Convert.ToInt32(table.Rows[i][0]),
                        Address = table.Rows[i][1].ToString(),
                        Description = table.Rows[i][2].ToString()
                    });
 
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            return details;
        }
    }
Person.cs:
public class Person : BindableBase
{
    private int _PersonID;
    private string _FirstName;
    private string _LastName;
 
    public int PersonID
    {
        get { return _PersonID; }
        set { this.SetProperty<int>(ref this._PersonID, value); }
    }
 
    public string FirstName
    {
        get { return _FirstName; }
        set { this.SetProperty<string>(ref this._FirstName, value); }
    }
 
    public string LastName
    {
        get { return _LastName; }
        set { this.SetProperty<string>(ref this._LastName, value); }
    }
 
    public static ObservableCollection<Person> GetPersons()
    {
        ObservableCollection<Person> persons = new ObservableCollection<Person>();
        try
        {
            DataTable table = new DataTable("person");
            DataColumn id = new DataColumn("PersonID", typeof(System.Int64));
            id.AutoIncrement = true;
            id.AutoIncrementSeed = 1;
            DataColumn FirstName = new DataColumn("FirstName", typeof(System.String));
            DataColumn LastName = new DataColumn("LastName", typeof(System.String));
            table.Columns.Add(id);
            table.Columns.Add(FirstName);
            table.Columns.Add(LastName);
 
            for (int i = 0; i < 5; i++)
            {
                DataRow row = table.NewRow();
                row["FirstName"] = "FirstName" + i.ToString();
                row["LastName"] = "LastName" + i.ToString();
                table.Rows.Add(row);
            }
 
            persons.Clear();
 
            for (int i = 0; i < table.Rows.Count; ++i)
                persons.Add(new Person
                {
                    PersonID = Convert.ToInt32(table.Rows[i][0]),
                    FirstName = table.Rows[i][1].ToString(),
                    LastName = table.Rows[i][2].ToString()
                });
 
 
 
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
 
        }
        return persons;
    }
 
 
}
MainViewModel.cs:
public class MainViewModel : BindableBase, INotifyPropertyChanged
{
    public MainViewModel()
    {
        this.Persons = Person.GetPersons();
    }
 
    private ObservableCollection<Person> personValues;
    public ObservableCollection<Person> Persons
    {
        get { return personValues; }
        set { this.SetProperty<ObservableCollection<Person>>(ref this.personValues, value); }
    }
 
 
    private ObservableCollection<PersonDetails> detailsvalues;
    public ObservableCollection<PersonDetails> Details
    {
        get
        {
            if (this.Selectedperson == null)
            {
                return null;
            }
            return this.LoadDetails(this.Selectedperson.PersonID);
        }
 
    }
 
    private ObservableCollection<PersonDetails> LoadDetails(int personID)
    {
        ObservableCollection<PersonDetails> details = new ObservableCollection<PersonDetails>();
        foreach (PersonDetails detail in PersonDetails.GetDetails().Where(item => item.PersonID == personID))
        {
            details.Add(detail);
        }
        return details;
    }
 
    private Person selectedPersonValue;
    public Person Selectedperson
    {
        get { return selectedPersonValue; }
        set
        {
            this.SetProperty<Person>(ref this.selectedPersonValue, value);
            this.RaiseNotification("Details");
        }
    }
 
}

We can't get working hierarchical RadGridView. When we trying to expand the parent row, we see the following in the Output window:
System.Windows.Data Error: 40 : BindingExpression path error: 'Details' property not found on 'object' ''Person' (HashCode=43402647)'.
BindingExpression:Path=Details; DataItem='Person' (HashCode=43402647); target element is 'RadGridView' (Name=''); target property is 'ItemsSource' (type 'Object')
We can't figure out what is wrong here, can you help us?
Onotole
Top achievements
Rank 1
 answered on 06 Aug 2013
1 answer
178 views
Hi guys,

I'm trying to use the pdfviewer but in the designer I get the message:

Error    93    Method 'RegisterMouseRightButtonDown' in type 'Telerik.Windows.Documents.Fixed.UI.MouseHandlers.SelectionHandler' from assembly 'Telerik.Windows.Controls.FixedDocumentViewers, Version=2013.1.220.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' does not have an implementation.

Can you help me?

David.

Alexander
Telerik team
 answered on 06 Aug 2013
3 answers
223 views
Hi,

I have live data coming from a sensor at a rate of 1khz. This data is plotted on a RadCartesianChart with two LinearAxis for X and Y. Only the last 10 seconds or so needs to be shown to the user. This is why I remove the first datapoint as soon as 10,001 datapoints are recorded.

When RangeExtendDirection="Positive" is set on the X-axis the graph scrolls along quite nice, however the range is not updated smoothly. The graph jumps every so often when the end is reached. I would like the X-position on screen of start and end of the graph to remain the same. Is this possible? I have not been able to find a way to alter the range of a graph.

Wouter
Rosko
Telerik team
 answered on 06 Aug 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
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?