or
<telerik:RadGridView Grid.Row="1" Name="pagesGridView" telerik:StyleManager.Theme="Vista" DataLoadMode="Synchronous" AutoGenerateColumns="False" CanUserInsertRows="False" CanUserFreezeColumns="False" UseAlternateRowStyle="True" ColumnsWidthMode="Auto" ShowGroupPanel="True" SourceUpdated="pagesGridView_SourceUpdated"> |
<telerik:RadGridView.Columns> |
<telerik:GridViewDataColumn x:Name="ParentColumn" HeaderText="Parent" Width="200" DataMemberBinding="{Binding Path=CmsPageParent.Title}" /> |
<telerik:GridViewDataColumn x:Name="StatusColumn" HeaderText="Status" Width="200" DataMemberBinding="{Binding Path=CmsItemState.Name}" /> |
<telerik:GridViewDataColumn x:Name="Title" HeaderText="Name" Width="*" DataMemberBinding="{Binding Path=Title}" /> |
</telerik:RadGridView.Columns> |
</telerik:RadGridView> |
Any help?
FrameworkElementFactory radComboFactory = new FrameworkElementFactory ( typeof ( RadComboBox ), "RadComboFactory" ); |
radComboFactory.SetValue ( RadComboBox.ItemsSourceProperty, property.AvailableValues ); |
radComboFactory.SetValue ( RadComboBox.SelectedValuePathProperty, "Key" ); |
radComboFactory.SetValue ( RadComboBox.SelectedValueProperty, currentValue ); |
radComboFactory.SetValue ( RadComboBox.IsDropDownOpenProperty, true ); |
radComboFactory.SetValue ( CSRadComboSelectionChanged.CommandProperty, CellEditTemplateComboSelectionChange ); |
propertyDataTemplate.VisualTree = radComboFactory; |
propertyDataTemplate.Seal ( ); |
System.NullReferenceException was unhandled Message="Object reference not set to an instance of an object." Source="Telerik.Windows.Controls.Input" StackTrace: at Telerik.Windows.Controls.RadComboBox.OnIsDropDownOpenChanged(Boolean oldValue, Boolean newValue) |
at Telerik.Windows.Controls.RadComboBox.OnIsDropDownOpenChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) |
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) |
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) |
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) |
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType) |
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal) |
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) |
at System.Windows.FrameworkTemplate.SetTemplateParentValues(String name, Object element, FrameworkTemplate frameworkTemplate, ProvideValueServiceProvider& provideValueServiceProvider) |
at System.Windows.FrameworkElementFactory.InstantiateUnoptimizedTree() |
at System.Windows.FrameworkTemplate.LoadContent() |
at Telerik.Windows.Controls.GridViewColumn.CreateCellEditElement(GridViewCell cell, Object dataItem) |
at Telerik.Windows.Controls.GridView.GridViewCell.SetEditorContent(Object content) |
at Telerik.Windows.Controls.GridView.GridViewCell.ShowEditor() |
at Telerik.Windows.Controls.GridView.GridViewCell.<ToggleEditor>b__0() |
at Telerik.Windows.Controls.GridView.GridViewCell.ModifyCellTemplate(Action executeAction) |
at Telerik.Windows.Controls.GridView.GridViewCell.ToggleEditor() |
at Telerik.Windows.Controls.GridView.EditContext.OnCellEditModeChanged(GridViewCell cell, Boolean newIsInEditMode) |
at Telerik.Windows.Controls.GridView.GridViewCell.IsInEditModeChanged(DependencyObject target, DependencyPropertyChangedEventArgs e) |
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) |
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) |
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) |
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType) |
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal) |
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) |
at Telerik.Windows.Controls.GridView.GridViewCell.set_IsInEditMode(Boolean value) |
at Telerik.Windows.Controls.GridView.EditContext.SwitchCellToEditMode(GridViewCell cell) |
at Telerik.Windows.Controls.GridView.EditContext.BeginEdit(GridViewCell gridViewCell) |
at Telerik.Windows.Controls.GridView.EditContext.OnCellMouseUp(GridViewCell cell) |
at Telerik.Windows.Controls.GridView.GridViewCell.OnMouseLeftButtonUp(MouseButtonEventArgs e) |
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e) |
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) |
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) |
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) |
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) |
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent) |
at System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e) |
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e) |
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) |
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) |
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) |
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) |
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) |
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) |
at System.Windows.Input.InputManager.ProcessStagingArea() |
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) |
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) |
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) |
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) |
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) |
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) |
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) |
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) |
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) |
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) |
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) |
at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) |
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) |
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) |
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) |
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) |
at System.Windows.Threading.Dispatcher.Run() |
at System.Windows.Application.RunDispatcher(Object ignore) |
at System.Windows.Application.RunInternal(Window window) |
at System.Windows.Application.Run(Window window) |
at System.Windows.Application.Run() |
at ***********.Shell.App.Main() in *****************************************************************\obj\Debug\App.g.cs:line 0 |
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) |
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) |
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() |
at System.Threading.ThreadHelper.ThreadStart_Context(Object state) |
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) |
at System.Threading.ThreadHelper.ThreadStart() |
<telerik:RadGridView Grid.Row="1" Name="pagesGridView" telerik:StyleManager.Theme="Vista" DataLoadMode="Synchronous" AutoGenerateColumns="False" CanUserInsertRows="False" CanUserFreezeColumns="False" UseAlternateRowStyle="True" ColumnsWidthMode="Auto" ShowGroupPanel="False"> |
<telerik:RadGridView.Columns> |
<telerik:GridViewDataColumn x:Name="IdColumn" HeaderText="Id" Width="75" DataMemberPath="Id" IsReadOnly="True" /> |
<telerik:GridViewDataColumn x:Name="StatusColumn" HeaderText="Link" Width="200" DataMemberPath="LinkUrl" /> |
<telerik:GridViewDataColumn x:Name="Title" HeaderText="Name" Width="*" DataMemberPath="Title" /> |
</telerik:RadGridView.Columns> |
</telerik:RadGridView> |
var corePages = contextCore.CmsPageSet.OrderBy(p => p.Title); |
pageListGridView.ItemsSource = corePages; |
Instead I have to...
var corePages = contextCore.CmsPageSet.OrderBy(p => p.Title); |
pageListGridView.ItemsSource = corePages.ToList(); |
Which is seriously suboptimal because it means grabbing all the records over the wire to project them into the list so that the grid is happy with them. Ugly, ugly, ugly.
It gets even worse because since this is not the astoria CTP2, I can't do projections on the server, either which means I pull down all the columns for each record, even though I only need three for the grid. I need Id, Title and Sortweight. Of those, I need Id to be hidden, so that I can access it as a key when a user clicks on a row (I need to pull up a window for the edit) but the user is not bothered with it in the grid proper.
So here are my questions....
Thanks!
public partial class Window1 : Window |
{ |
RadTileViewItem item0 = new RadTileViewItem() { Header = "1" }; |
RadTileViewItem item1 = new RadTileViewItem() { Header = "2" }; |
RadTileViewItem item2 = new RadTileViewItem() { Header = "3" }; |
public Window1() |
{ |
InitializeComponent(); |
tileview.Items.Add(item0); |
tileview.Items.Add(item1); |
tileview.Items.Add(item2); |
} |
void btn_Click(object sender, RoutedEventArgs e) |
{ |
tileview.Items.Remove(item1); |
} |
} |
<Window x:Class="addDeleteTileViewItem.Window1" |
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"> |
<Grid> |
<Grid.RowDefinitions> |
<RowDefinition Height="30" /> |
<RowDefinition /> |
</Grid.RowDefinitions> |
<Button Click="btn_Click" /> |
<telerik:RadTileView Name="tileview" Grid.Row="1" /> |
</Grid> |
</Window> |