After assigning GridView ItemsSource to an ObjectSet<Company> as below:
radGridView.ItemsSource = context.Companies
(context is the ObjectContext from Entity Framework 4.0), the only way to automatically get the GridView updated with inserted/deleted items is by calling context.SaveChanges(); this approach is not well suitable, at least, for my needs since I’ve to commit any single change instead of gathering all changes, grouping and filtering on row state (see EntityState property and Added, Modified and Unmodified values), and finally committing.
Where my approach is correct, due to the relevance of Entity Framework in .NET 4.0 platform, are you planning a tighter integration? If yes, what and when?
Thanks
Hello,
I have a chart with 8 data series, like the live data example in the WPF Demos.
I want to hide one ore more of these series, I tried to set the SeriesVisibility of the corresponding SeriesMapping, but it doesn't seem to work. How can I achieve this without removing the SeriesMapping?
<telerik:GridViewDataColumn Header="Criteria" CellEditTemplateSelector="{StaticResource CellEditTemplateSelector}" CellTemplateSelector="{StaticResource CellTemplateSelector}"/> |
return (container as GridViewCell).FindResource("RangeGridSelector") as DataTemplate; |
<DataTemplate x:Key="RangeGridSelector"> |
<telerik:RadGridView AutoGenerateColumns="False" |
ShowGroupPanel="False" |
CanUserReorderColumns="False" |
ItemsSource="{Binding Path=Criterias}"> |
<telerik:RadGridView.Columns> |
<telerik:GridViewSelectColumn /> |
<telerik:GridViewDataColumn Header="Criteria" DataMemberBinding="{Binding}"/> |
</telerik:RadGridView.Columns> |
</telerik:RadGridView> |
</DataTemplate> |
<DataTemplate x:Name="DatePickerCellTemplate" x:Key="DatePickerCellTemplate"> |
<telerik:RadDatePicker SelectedDate="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:GridViewCell}},Path=Value, Mode=TwoWay}" /> |
</DataTemplate> |
<
telerikControls:RadGridView Name="MyGrid" CanUserFreezeColumns="False" ....
with a column like this:
<
telerikControls:GridViewDataColumn Header="MyColumn" IsFilterable="False"
DataMemberBinding="{Binding MyProperty}">
<telerikControls:GridViewDataColumn.AggregateFunctions>
<telerikData:CountFunction Caption="Count: " />
</telerikControls:GridViewDataColumn.AggregateFunctions>
</telerikControls:GridViewDataColumn> ...
and somewhere in the UI, a textblock like this:
<
TextBlock Name="MyTextBlock" Text="{Binding ElementName=MyGrid, Path=???CountResultFromFooter???}" />
How can I bind to MyTextBlock the result of the count aggregate function from MyColumn column?
I am using Telerik RadGridView in my project. I want to show image in column.
GridViewImageColumn col1 = new GridViewImageColumn(); |
col1.Width = 100; |
col1.DataMemberBinding = new Binding("id"); |
col1.Header = "PhotoByConverter"; |
col1.DataMemberBinding.Converter = new ThumbnailConverter(); |
grid.Columns.Add(col1); |
GridViewDataColumn col2 = new GridViewDataColumn(); |
col2.Width = 100; |
col2.DataMemberBinding = new Binding("firstName"); |
col2.Header = "Person name"; |
grid.Columns.Add(col2); |
Grid.ItemsSource=DataTable; |
public class ThumbnailConverter : IValueConverter |
{ |
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) |
{ |
IEnumerable<thumbNail> result = from n in thumbnails |
where n.personID == value.ToString() |
select n; |
if (result != null && result.First().thumbnail != null) |
{ |
return result.First().thumbnail.file; |
} |
else |
{ |
return null; |
} |
} |
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) |
{ |
throw new Exception("The method or operation is not implemented."); |
} |
} |
I found by id thumbnail of person and set it like data for GridViewImageColumn. I checked with Debuger conveter works properly. I can't undesrtand why it doesn't work. Any ideas?
I use 2009 Q3 version.
My converter returns byte[] type
namespace WpfApplication7 |
{ |
public class MyGrid : RadGridView |
{ |
public override void OnApplyTemplate() |
{ |
//Custom Code. |
} |
} |
} |
<Window x:Class="WpfApplication7.Window1" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:gridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" |
xmlns:local="clr-namespace:WpfApplication7" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
Title="Window1" Height="300" Width="300"> |
<Grid> |
<local:MyGrid> |
<gridView:RadGridView.Columns> |
<gridView:GridViewColumn Header="Column1"/> |
<gridView:GridViewColumn Header="Column2"/> |
<gridView:GridViewColumn Header="Column3"/> |
<gridView:GridViewColumn Header="Column4"/> |
</gridView:RadGridView.Columns> |
</local:MyGrid> |
</Grid> |
</Window> |