Grid ist after added new item empty

2 posts, 0 answers
  1. Reinhard
    Reinhard avatar
    9 posts
    Member since:
    Jun 2010

    Posted 17 Jun 2011 Link to this post


    I have a Test UC within a simple WPF-Grid an for test a Telerik RadGridView.When i added a new item, in the WPF-Grid, the Item is there, but in the Telerik Grid is after that empty. It shows new rows, but they are still empty (nothing is displayed.)

    My Text xaml:
    <UserControl x:Class="KfzOrtung6.Modells.UserControl1"
                 d:DesignHeight="498" d:DesignWidth="924"
            <CollectionViewSource x:Key="fahrzeugeViewSource" d:DesignSource="{d:DesignInstance my:Fahrzeuge, CreateList=True}" />
        <Grid DataContext="{StaticResource fahrzeugeViewSource}">
            <DataGrid AutoGenerateColumns="False" EnableRowVirtualization="True" Height="88" HorizontalAlignment="Left" ItemsSource="{Binding}" Margin="32,28,0,0" Name="fahrzeugeDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected" VerticalAlignment="Top" Width="654">
                    <DataGridTemplateColumn x:Name="ablaufsimkarteColumn" Header="Ablaufsimkarte" Width="SizeToHeader">
                                <DatePicker SelectedDate="{Binding Path=Ablaufsimkarte, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" />
                    <DataGridTextColumn x:Name="aktivColumn" Binding="{Binding Path=Aktiv}" Header="Aktiv" Width="SizeToHeader" />
                    <DataGridTextColumn x:Name="bemerkungColumn" Binding="{Binding Path=Bemerkung}" Header="Bemerkung" Width="SizeToHeader" />
                    <DataGridTextColumn x:Name="iDColumn" Binding="{Binding Path=ID}" Header="ID" Width="SizeToHeader" />
                    <DataGridTextColumn x:Name="kennzeichenColumn" Binding="{Binding Path=Kennzeichen}" Header="Kennzeichen" Width="SizeToHeader" />
                    <DataGridTemplateColumn x:Name="nameColumn" Header="Name" Width="SizeToHeader">
                                    <ComboBoxItem Content="{Binding Path=Name}" />
                    <DataGridTextColumn x:Name="rufnummerColumn" Binding="{Binding Path=Rufnummer}" Header="Rufnummer" Width="SizeToHeader" />
            <telerik:RadGridView x:Name="mygrid" Margin="32,136,0,35"
                                 ItemsSource="{Binding}" HorizontalAlignment="Left" Width="654">
            <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="795,162,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />

    My cs:
    using System;
    using System.Collections.Generic;
    using System.Data.Entity;
    using System.Linq;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    using KfzOrtung6DataClasses.Modells;
    namespace KfzOrtung6.Modells
        /// <summary>
        /// Interaktionslogik für UserControl1.xaml
        /// </summary>
        public partial class UserControl1 : UserControl
            KfzContext6 kt = new KfzContext6();
            public UserControl1()
            private void UserControl_Loaded(object sender, RoutedEventArgs e)
                var cc = kt.MFahrzeuge.Local;
                // Laden Sie Ihre Daten nicht zur Entwurfszeit.
                //if (!System.ComponentModel.DesignerProperties.GetIsInDesignMode(this))
                //  //Laden Sie hier Ihre Daten, und weisen Sie das Ergebnis der CollectionViewSource zu.
                CollectionViewSource myCollectionViewSource = (CollectionViewSource)this.Resources["fahrzeugeViewSource"];
                    myCollectionViewSource.Source = cc;
            private void button1_Click(object sender, RoutedEventArgs e)
                Fahrzeuge fz = new Fahrzeuge
                    ID = Guid.NewGuid(),
                    Name = "LKW Test 2",
                    Kennzeichen = "Sad-Br-505",
                    Ablaufsimkarte = new DateTime(2000, 1, 1),
                    Rufnummer = "",
                    Aktiv = 1

    Please can you help?


  2. Maya
    Maya avatar
    4062 posts

    Posted 22 Jun 2011 Link to this post

    Hello Reinhard,

    I have tried to simulate the scenario described, but I was not able to reproduce the same behavior. May you take a look at the sample attached to verify whether there are any misunderstandings ? If so, may you provide the steps required so that I can reproduce your scenario ?

    All the best,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
Back to Top