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="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> |