or
DataTable table = new DataTable();
table.Columns.Add(new DataColumn("Date Column 1", typeof(DateTime)));
table.Columns.Add(new DataColumn("Date Column 2", typeof(DateTime)));
table.Columns.Add(new DataColumn("String Column 1", typeof(string)));
table.Columns.Add(new DataColumn("String Column 2", typeof(string)));
DataRow row1 = table.NewRow();
row1[table.Columns[0]] = DateTime.Now;
row1[table.Columns[1]] = DateTime.Now.AddDays(10);
row1[table.Columns[2]] = "some string";
row1[table.Columns[3]] = "some other string";
table.Rows.Add(row1);
radGridView1.ItemsSource = table;<telerik:RadGridView HorizontalAlignment="Stretch" Name="radGridView1" VerticalAlignment="Stretch" AutoGenerateColumns="True">
<telerik:RadGridView.Resources>
<DataTemplate x:Key="TextCellEditorTemplate">
<TextBox Background="LightYellow" MaxWidth="250" TextWrapping="Wrap" AcceptsReturn="True"
Text="{Binding WHAT_GOES_HERE?}" />
</DataTemplate>
<DataTemplate x:Key="DateTimeCellEditorTemplate">
...
</DataTemplate>
<DataTemplate x:Key="IntegerCellEditorTemplate">
...
</DataTemplate>
</telerik:RadGridView.Resources>
</telerik:RadGridView><ecu:GroupHeaderStyleSelector x:Key="GroupHeaderStyleSelector"> <ecu:GroupHeaderStyleSelector.DateStyle> <Style TargetType="telerik:GroupHeader"> <Setter Property="Visibility" Value="Collapsed"/> </Style> </ecu:GroupHeaderStyleSelector.DateStyle> <ecu:GroupHeaderStyleSelector.EventCreationStyle> <Style TargetType="telerik:GroupHeader"> <Setter Property="Visibility" Value="Visible"/> <Setter Property="Height" Value="100"></Setter> <Setter Property="VerticalAlignment" Value="Top"> </Setter> <Setter Property="ContentTemplate"> <Setter.Value> <DataTemplate> <TextBlock>Audio</TextBlock> </DataTemplate> </Setter.Value> </Setter> <!--<Setter Property="Template" Value="{StaticResource Testing}"></Setter>--> </Style> </ecu:GroupHeaderStyleSelector.EventCreationStyle> </ecu:GroupHeaderStyleSelector><telerik:RadScheduleView Grid.Row="2" DialogClosing="eventsTimeline_DialogClosing_1" AppointmentsSource="{Binding Events, Mode=TwoWay}" NavigationHeaderVisibility="Collapsed" ShowDialog="RadScheduleView_ShowDialog" ResourceTypesSource="{Binding EventTypes}" TimeRulerItemStyleSelector="{StaticResource TimeRulerItemStyleSelector}" GroupHeaderStyleSelector="{StaticResource GroupHeaderStyleSelector}" AppointmentEditing="RadScheduleView_AppointmentEditing" AppointmentSaving="eventsTimeline_AppointmentSaving" AppointmentCreating="eventsTimeline_AppointmentCreating_1" AppointmentCreated="eventsTimeline_AppointmentCreated" AppointmentSelectionChanged="eventsTimeline_AppointmentSelectionChanged_1" AppointmentDeleting="eventsTimeline_AppointmentDeleting_1" AppointmentDeleted="eventsTimeline_AppointmentDeleted_1" DeleteAppointmentConfirmDialogStyle="{StaticResource DeleteEventConfirmDialogStyle}" ResizeHighlightStyle="{StaticResource EventResizeHighlightStyle}" Name="eventsTimeline" VerticalAlignment="Top"> <telerik:RadScheduleView.ViewDefinitions> <telerik:DayViewDefinition VisibleDays="1" MajorTickLength="5min" MinorTickLength="1min" MinTimeRulerExtent="5000" TimerulerMajorTickStringFormat="{}{0: HHmm}" DayStartTime="00:00:00" DayEndTime="3:00:00" Orientation="Horizontal"> </telerik:DayViewDefinition> </telerik:RadScheduleView.ViewDefinitions> <telerik:RadScheduleView.DragDropBehavior> <ecu:EventCreationDragDropBehavior /> </telerik:RadScheduleView.DragDropBehavior> <telerik:RadScheduleView.AppointmentStyleSelector> <ecu:EventStyleSelector AudioEventStyle="{StaticResource AudioEvent}" OdorEventStyle="{StaticResource OdorEvent}" LightingEventStyle="{StaticResource LightingEvent}" SmokeEventStyle="{StaticResource SmokeEvent}"/> </telerik:RadScheduleView.AppointmentStyleSelector> <telerik:RadScheduleView.GroupDescriptionsSource> <telerik:GroupDescriptionCollection> <telerik:ResourceGroupDescription ResourceType="Event Types" /> </telerik:GroupDescriptionCollection> </telerik:RadScheduleView.GroupDescriptionsSource> </telerik:RadScheduleView><controls3:RadGridView x:Name="Sports" ShowGroupPanel="False" ItemsSource="{Binding AllSports}" AutoGenerateColumns="False" RowIndicatorVisibility="Collapsed" CanUserSelect="False" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<controls3:RadGridView.Columns> <controls3:GridViewCheckBoxColumn DataMemberBinding="{Binding IsSelected}" Header="Chosen" ForceCursor="True" IsThreeState="False" /> <controls3:GridViewDataColumn Width="239" DataMemberBinding="{Binding name}" Header="Name"/> </controls3:RadGridView.Columns></controls3:RadGridView><telerik:RadAutoCompleteBox Name="radAutoCompleteBox1" Grid.Column="2" Grid.Row="0" DataContext="{Binding DetailViewModel}" SelectionMode="Multiple" WatermarkContent="Type a name" TextSearchMode="Contains" ItemsSource="{Binding BookstoreLookup}" DisplayMemberPath="ShortName" TextSearchPath="ShortName" AutoCompleteMode="Suggest" SelectedItems="{Binding SelectedNoticeItem.Bookstores, Mode=TwoWay}" />Column cannot be nullNom du paramètre : newColumnà Telerik.Windows.Controls.GridView.ColumnGroupDescriptor.OnColumnChanged(GridViewColumn oldColumn, GridViewColumn newColumn)à Telerik.Windows.Controls.GridView.ColumnGroupDescriptor.OnColumnPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)à System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)à System.Windows.Freezable.OnPropertyChanged(DependencyPropertyChangedEventArgs e)à System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)à System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)à System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)à System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)à System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)à System.Windows.Data.BindingExpression.ScheduleTransfer(Boolean isASubPropertyChange)à MS.Internal.Data.ClrBindingWorker.NewValueAvailable(Boolean dependencySourcesChanged, Boolean initialValue, Boolean isASubPropertyChange)à MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView, Object newValue, Boolean isASubPropertyChange)à MS.Internal.Data.ClrBindingWorker.OnSourcePropertyChanged(Object o, String propName)à MS.Internal.Data.PropertyPathWorker.OnPropertyChanged(Object sender, PropertyChangedEventArgs e)à System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType)à System.ComponentModel.PropertyChangedEventManager.OnPropertyChanged(Object sender, PropertyChangedEventArgs args)à System.Collections.ObjectModel.ObservableCollection`1.OnPropertyChanged(PropertyChangedEventArgs e)à System.Collections.ObjectModel.ObservableCollection`1.ClearItems()à Telerik.Windows.Controls.GridViewColumnCollectionInternal.ClearItems()à System.Collections.ObjectModel.Collection`1.Clear()à Telerik.Windows.Controls.GridView.GridViewDataControl.TotalColumnRefresh()à Telerik.Windows.Controls.GridView.GridViewDataControl.Grid_Loaded(Object sender, RoutedEventArgs e)à System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)à System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)à System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)à System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)à System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)à System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)à MS.Internal.LoadedOrUnloadedOperation.DoWork()à System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()à System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()à System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)à System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)à System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)à MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)à System.Windows.Threading.DispatcherOperation.InvokeImpl()à System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)à System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)à System.Windows.Threading.DispatcherOperation.Invoke()à System.Windows.Threading.Dispatcher.ProcessQueue()à System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)à MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)à MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)à System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)à MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)à System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)à MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)à MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)à System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)à System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)à System.Windows.Threading.Dispatcher.Run()à System.Windows.Application.RunDispatcher(Object ignore)à System.Windows.Application.RunInternal(Window window)à System.Windows.Application.Run(Window window)à System.Windows.Application.Run()à BaseCamp.App.Main() dans d:\ManagerEntrepriseVS\BaseCamp\BaseCamp\obj\Debug\App.g.cs:ligne 0<telerik:RadTabItem Header="{Binding Resource.PerSupplier}"> <telerik:RadGridView x:Name="QuotationDashBoardGrid" ShowGroupPanel="true" AutoGenerateColumns="False" ItemsSource="{Binding LstQuotationDashBoard, Mode=TwoWay}" SelectedItem="{Binding SelectedQuotation, Mode=TwoWay}" IsReadOnly="True" > <telerik:RadGridView.GroupDescriptors> <telerik:ColumnGroupDescriptor Column="{Binding Columns[SupplierColumn],ElementName=QuotationDashBoardGrid}" SortDirection="Ascending" /> </telerik:RadGridView.GroupDescriptors> <telerik:RadGridView.Columns> <telerik:GridViewImageColumn ImageHeight="17" ImageWidth="17" DataMemberBinding="{Binding DiscountIndication,Converter={StaticResource QuotationToUri}}" Header="" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding CodeTarif}" Header="{Binding Resource.DiscountCode}" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding FamilleLibelle}" Header="{Binding Resource.DiscountLabel}" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding DisplayDiscount}" Header="{Binding Resource.Discount}" /> <telerik:GridViewDataColumn Header="{Binding Resource.Note}" DataMemberBinding="{Binding Note}"/> <telerik:GridViewDataColumn DataMemberBinding="{Binding DiscountDealName}" Header="{Binding Resource.DiscountDealName}" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding OuContractedName}" Header="{Binding Resource.OU}" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding RootSupplierName}" UniqueName="SupplierColumn" Header="{Binding Resource.Supplier}" /> </telerik:RadGridView.Columns> </telerik:RadGridView> </telerik:RadTabItem>