Hi,
I am trying to to save and load the grid layout settings to/from a file. i am able to save the layout settings to a file but unable to load from the file, getting the below error. Here i have created custom header cell for my grid.
Could you please help me in resolving this issue?
Below is the code snipper for Save / Laod
private void SaveLayout_Click(object sender, EventArgs e) { this.radGridView1.SaveLayout(@"C:\\xyz.xml"); } private void RestoreLayout_Click(object sender, EventArgs e) { this.radGridView1.LoadLayout(@"C:\\xyz.xml"); }Stack Tracer of the issue:
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at Telerik.WinControls.XmlSerialization.RuntimeInstanceFactory.CreateInstance(Type instanceType) at Telerik.WinControls.XmlSerialization.ComponentXmlSerializer.ReadMergeCollection(XmlReader reader, Object parent, PropertyDescriptor parentProperty, IList toRead, String uniquePropertyName, Boolean preserveNotSerializedExistingElements, Boolean disposeObjects) at Telerik.WinControls.UI.GridViewLayoutSerializer.ProcessListOverride(XmlReader reader, Object listOwner, PropertyDescriptor ownerProperty, IList list) at Telerik.WinControls.XmlSerialization.ComponentXmlSerializer.ReadElementInObject(XmlReader reader, PropertyDescriptor property, Object toRead) at Telerik.WinControls.XmlSerialization.ComponentXmlSerializer.ReadObjectElement(XmlReader reader, Object parentObject, Object toRead) at Telerik.WinControls.XmlSerialization.ComponentXmlSerializer.ReadElementInObject(XmlReader reader, PropertyDescriptor property, Object toRead) at Telerik.WinControls.XmlSerialization.ComponentXmlSerializer.ReadObjectElement(XmlReader reader, Object parentObject, Object toRead) at Telerik.WinControls.UI.RadGridView.LoadLayout(XmlReader xmlReader) at Telerik.WinControls.UI.RadGridView.LoadLayout(String fileName) at GridApplication.Form1.RestoreLayout_Click(Object sender, EventArgs e) in E:\Telerik POC\GridApplication\GridApplication\Form1.cs:line 200 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at GridApplication.Program.Main() in E:\Telerik POC\GridApplication\GridApplication\Program.cs:line 18 at System.AppDomain._nExecuteAssembly(RuntimeAssembly 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, Boolean ignoreSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()Thanks & Regards
Muralidhar Dasari