public MainWindow()
{
InitializeComponent();
radMap1.Provider = new BingMapProvider(MapMode.Road, true, "KeyValue");
layer.Items.Add(lc1);
layer.Items.Add(lc2);
LocationRect lr = new LocationRect(lc1, lc2);
radMap1.SetView(lr);
}
private void button1_Click(object sender, RoutedEventArgs e) //Zoom seems to be working fine when you click the button
{
LocationRect lr1 = new LocationRect(lc1,lc2);
radMap1.SetView(lr1);
}
I get the following error in the designer of VS2010. The project compiles and runs fine, but the designer has this error. I've checked all the references and I am not referencing any older versions anywhere. I've cleaned and rebuilt the solution and it still doesn't work. I've also added the loadFromRemoteSources option to the app.config. Still no good.
System.IO.FileLoadException
Could not load file or assembly 'Telerik.Windows.Controls, Version=2010.3.1227.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.Assembly.Load(AssemblyName assemblyRef) at MS.Internal.Package.VSIsolationProviderService.RemoteReferenceProxy.VsReflectionResolver.GetRuntimeAssembly(Assembly reflectionAssembly) at Microsoft.Windows.Design.Metadata.ReflectionMetadataContext.CachingReflectionResolver.GetRuntimeAssembly(Assembly reflectionAssembly) at Microsoft.Windows.Design.Metadata.ReflectionMetadataContext.Microsoft.Windows.Design.Metadata.IReflectionResolver.GetRuntimeAssembly(Assembly reflectionAssembly) at MS.Internal.Metadata.ClrAssembly.GetRuntimeMetadata(Object reflectionMetadata) at Microsoft.Windows.Design.Metadata.AttributeTableContainer.<MergeAttributesIterator>d__c.MoveNext() at Microsoft.Windows.Design.Metadata.AttributeTableContainer.GetAttributes(Assembly assembly, Type attributeType, Func`2 reflectionMapper) at MS.Internal.Metadata.ClrAssembly.GetAttributes(ITypeMetadata attributeType) at MS.Internal.Design.Metadata.Xaml.XamlAssembly.get_XmlNamespaceCompatibilityMappings() at Microsoft.Windows.Design.Metadata.Xaml.XamlExtensionImplementations.GetXmlNamespaceCompatibilityMappings(IAssemblyMetadata sourceAssembly) at Microsoft.Windows.Design.Metadata.Xaml.XamlExtensions.GetXmlNamespaceCompatibilityMappings(IAssemblyMetadata source) at MS.Internal.Design.Metadata.ReflectionProjectNode.BuildSubsumption() at MS.Internal.Design.Metadata.ReflectionProjectNode.SubsumingNamespace(Identifier identifier) at MS.Internal.Design.Markup.XmlElement.BuildScope(PrefixScope parentScope, IParseContext context) at MS.Internal.Design.Markup.XmlElement.ConvertToXaml(XamlElement parent, PrefixScope parentScope, IParseContext context, IMarkupSourceProvider provider, Boolean visitCodeModel) at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.FullParse(Boolean convertToXamlWithErrors) at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.get_RootItem() at Microsoft.Windows.Design.DocumentModel.Trees.ModifiableDocumentTree.get_ModifiableRootItem() at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.get_LoadState() at MS.Internal.Host.PersistenceSubsystem.Load() at MS.Internal.Host.Designer.Load() at MS.Internal.Designer.VSDesigner.Load() at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.Load() at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.Load(IsolatedView view) at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view) at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view) at MS.Internal.Host.Isolation.IsolatedDesigner.Load() at MS.Internal.Designer.DesignerPane.LoadDesignerView(Boolean isReload)
System.NotSupportedException
An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
mainGrid.ScrollIntoView(mainGrid.SelectedItem);
mainGrid.BringIndexIntoView(mainGrid.Items.IndexOf(mainGrid.SelectedItem));
Dispatcher.BeginInvoke(new Action(() => mainGrid.ScrollIntoView(mainGrid.SelectedItem)));
Dispatcher.BeginInvoke(new Action(() => mainGrid.BringIndexIntoView(mainGrid.Items.IndexOf(mainGrid.SelectedItem))));
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Shapes;using System.Collections.ObjectModel;using System.Data;namespace WpfApplication8{ /// <summary> /// Interaction logic for Window3.xaml /// </summary> public partial class Window3 : Window { public Window3() { InitializeComponent(); this.DataContext = this; //RadGridView1.DataMember = CarsSet.Tables["Car"].TableName; } public DataSet CarsSet { get { DataSet carSet = new DataSet(); DataTable car = new DataTable("Car"); DataTable comp = new DataTable("Complaint"); DataColumn col = new DataColumn("AllWheelDrive"); car.Columns.Add(col); col = new DataColumn("Doors"); car.Columns.Add(col); col = new DataColumn("Make"); car.Columns.Add(col); col = new DataColumn("Model"); car.Columns.Add(col); col = new DataColumn("ModelYear"); car.Columns.Add(col); col = new DataColumn("Doors"); comp.Columns.Add(col); col = new DataColumn("DateOfComplaint"); comp.Columns.Add(col); col = new DataColumn("Complaint"); comp.Columns.Add(col); col = new DataColumn("Resolved"); comp.Columns.Add(col); DataRow row = car.NewRow(); row["Doors"] = "test1"; row["Make"] = "test2"; row["Model"] = "test3"; row["ModelYear"] = "test4"; car.Rows.Add(row); row = comp.NewRow(); row["Doors"] = "test1"; row["DateOfComplaint"] = "test4"; row["Complaint"] = "test2"; row["Resolved"] = "test3"; comp.Rows.Add(row); carSet.Tables.Add(car); carSet.Tables.Add(comp); carSet.Relations.Add(new DataRelation("link", carSet.Tables["Car"].Columns["Doors"], carSet.Tables["Complaint"].Columns["Doors"])); return carSet; } } }}
<Window xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="WpfApplication8.Window3" Title="Window3" Height="300" Width="600"> <Grid> <telerik:RadGridView x:Name="RadGridView1" CanUserFreezeColumns="False" GridLinesVisibility="Horizontal" ShowInsertRow="true" DataMember="Car" ItemsSource="{Binding CarsSet}" AutoGenerateColumns="False"> <telerik:RadGridView.ChildTableDefinitions> <telerik:GridViewTableDefinition /> </telerik:RadGridView.ChildTableDefinitions> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn DataMemberBinding="{Binding AllWheelDrive}" Header="Order Date" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding Doors}" Header="Employee" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding Make}" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding Model}" Header="Ship Country" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding ModelYear}" Header="Ship City" /> </telerik:RadGridView.Columns> <telerik:RadGridView.HierarchyChildTemplate> <DataTemplate> <telerik:RadGridView x:Name="RadGridView1" DataMember="Complaint" CanUserFreezeColumns="False" ShowInsertRow="true" CanUserInsertRows="True" AutoGenerateColumns="False" ItemsSource="{Binding Complaint}" ShowGroupPanel="False"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn DataMemberBinding="{Binding DateOfComplaint}" Header="Product ID" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding Complaint}" Header="Unit Price" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding Resolved}" Header="Quantity" /> </telerik:RadGridView.Columns> </telerik:RadGridView> </DataTemplate> </telerik:RadGridView.HierarchyChildTemplate> </telerik:RadGridView> </Grid></Window>