Hello,
I have a program I am creating where the tileview represents a collection of computers, with one tile per computer. The data that backs this is bound as follows;
<
telerik:RadTileView
x:Name
=
"radTileView"
MaximizeMode
=
"ZeroOrOne"
ColumnWidth
=
"250"
ItemsSource
=
"{Binding Data, Source={StaticResource context}}"
ItemTemplate
=
"{StaticResource ItemTemplate}"
ContentTemplate
=
"{StaticResource ContentTemplate}"
IsVirtualizing
=
"True"
RowHeight
=
"250"
Grid.Column
=
"2"
Grid.Row
=
"0"
Margin
=
"8,1,10,10"
/>
In my ViewModel, Data is an observable collection, like this;
private
ObservableCollection<ImagingData> _imagingData =
new
ObservableCollection<ImagingData>();
public
ObservableCollection<ImagingData> Data
{
get
{
return
_imagingData;
}
set
{
_imagingData = value;
OnPropertyChanged(() =>
this
.Data);
}
}
Data is updated by a timer event that polls a database backend. If i simply update Data by replacing it, everything works fine, except it makes for a poor UI experience since the pane resets constantly. To make for a better experience, where tiles stay maximized, and stay where you put them, i implemented a sort of delta sync. When the timer event pops, I call UpdateData() with the UI dispatcher. UpdateData copies Data to an array, then adds new records, deletes records that are not in scope anymore, and updates fields on records that already exist. it is a crude proof of concept, but here it is;
private
void
UpdateData(ImagingData[] newItems, ImagingData[] existing)
{
//var dataArray = _imagingData.ToArray();
foreach
(var item
in
existing)
{
var matchedItem = newItems.Where(c => c.ComputerName == item.ComputerName).FirstOrDefault();
if
(matchedItem ==
null
)
Data.Remove(item);
}
foreach
(var item
in
newItems)
{
var matchedItem = existing.Where(c => c.ComputerName == item.ComputerName).FirstOrDefault();
if
(matchedItem ==
null
)
{
Data.Add(item);
return
;
}
matchedItem.ImagingPasses = item.ImagingPasses;
matchedItem.LastKnownActivity = item.LastKnownActivity;
matchedItem.ImagingState = item.ImagingState;
}
OnPropertyChanged(
"Data"
);
}
The problem I am having that when i use this method, only 1 record is added to the Data collection each time the update timer fires, even though I have confirmed that the update loop does iterate over all the members. Visually, you see one tile appear, then the next, then the next, etc, separated by one timer iteration. I have tried all manner of different ways to remedy this but nothing seems to work.
I get an XmlParseException when I place a RadDiagram control at the same level as a RadDocking control and attempt to run.
<Window x:Class="TelerikWpfApp1.MainWindow"
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"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<telerik:RadDiagram>
</telerik:RadDiagram>
<telerik:RadDocking Grid.Column="2">
</telerik:RadDocking>
</Grid>
</Window>
System.Windows.Markup.XamlParseException occurred
HResult=-2146233087
LineNumber=14
LinePosition=11
Message=Could not load file or assembly 'Telerik.Windows.Controls, Version=2016.2.503.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source=PresentationFramework
StackTrace:
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at TelerikWpfApp1.MainWindow.InitializeComponent() in D:\visual studio 2015 Projects\TelerikWpfSolution\TelerikWpfApp1\MainWindow.xaml:line 1
InnerException:
FileName=Telerik.Windows.Controls, Version=2016.2.503.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7
FusionLog==== Pre-bind state information ===
LOG: DisplayName = Telerik.Windows.Controls, Version=2016.2.503.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7
(Fully-specified)
LOG: Appbase = file:///D:/visual studio 2015 Projects/TelerikWpfSolution/TelerikWpfApp1/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : Telerik.Windows.Controls.Docking, Version=2016.2.503.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\visual studio 2015 Projects\TelerikWpfSolution\TelerikWpfApp1\bin\Debug\TelerikWpfApp1.vshost.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Telerik.Windows.Controls, Version=2016.2.503.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7
LOG: Attempting download of new URL file:///D:/visual studio 2015 Projects/TelerikWpfSolution/TelerikWpfApp1/bin/Debug/Telerik.Windows.Controls.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
HResult=-2146234304
Message=Could not load file or assembly 'Telerik.Windows.Controls, Version=2016.2.503.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source=mscorlib
StackTrace:
at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type)
at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
at System.Reflection.Assembly.GetType(String name, Boolean throwOnError)
at System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlTypeToType(BamlType bamlType)
at System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlType(BamlType bamlType, Int16 typeId)
at System.Windows.Baml2006.Baml2006SchemaContext.GetXamlType(Int16 typeId)
at System.Windows.Baml2006.Baml2006Reader.Process_ElementStart()
at System.Windows.Baml2006.Baml2006Reader.Process_OneBamlRecord()
at System.Windows.Baml2006.Baml2006Reader.Process_BamlRecords()
at System.Windows.Baml2006.Baml2006Reader.Read()
at System.Windows.Markup.WpfXamlLoader.TransformNodes(XamlReader xamlReader, XamlObjectWriter xamlWriter, Boolean onlyLoadOneNode, Boolean skipJournaledProperties, Boolean shouldPassLineNumberInfo, IXamlLineInfo xamlLineInfo, IXamlLineInfoConsumer xamlLineInfoConsumer, XamlContextStack`1 stack, IStyleConnector styleConnector)
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
InnerException:
Hello team,
I'm trying to acces IsReadOnly property from header style to change its foreground color. For now, I didn't find a solution. I'm trying the following:
<Style x:Key="GridViewHeaderCellStyle" TargetType="{x:Type telerik:GridViewHeaderCell}">
...
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:GridViewDataColumn}}, Path=Column.IsReadOnly}" Value="false">
<Setter Property="Foreground" Value="{DynamicResource primaryBrush}" />
</DataTrigger>
</Style.Triggers>
</Style>
I'm sure this is trivial, but I don't see a property that would make it happen. I'd like to make my entire GanttView read-only, so that it doesn't permit any changes to dates or tasks either in the text columns or by dragging tasks around. I've tried setting "IsEnabled" to false, but that prevents me from resizing the columns. Suggestions?
Thanks!
Brad.
Hello,
I have a flollowing problem in the RadChart control. I've defined brushes like this
<telerik:RadChart.PaletteBrushes>
<SolidColorBrush Color="Green" />
<SolidColorBrush Color="Gray" />
<SolidColorBrush Color="Orange" />
</telerik:RadChart.PaletteBrushes>
which works fine,but I wanted to reuse this in many places if possible. How can I do it?
Alternatively can I set a Brush for each slice via Binding? My viewmodel for the slice has a Brush property let's say MyBrush. Is there a way to bind it in a series definition?
Thanks in advance!
Krzysztof
Launch the Telerik WPF Demos, and go to the "Filtering Configuration" demo.
Change the FilteringMode to FilterRow
Type some text in one of the filter textboxes
Using your mouse, attempt to click and drag to highlight this text.
The column reordering mechanism of the grid kicks in, instead of highlighting the text as would be expected.
Is there any way to change this behaviour?
Thanks
Hi, I add a new xmlelement(ele1) throw the datacontext, and I set the radtreeview.selecteditem=ele1. Then it trigger the selectchanged event, it's easy to get the new node's xmlelement object in this event, but I don't know how to get the new node's radtreeviewitem object.
How to do it ? Cause I want to call the radtreeviewitem's beginedit() event to let node start edit style automatically. Thanks!