Serialize throws Nullpointer Exception
Hello,
I used the Serialize/Deserialize functions of the datagrid with success.
... Until I have put the Grid in a Panel of the SplitContainerAdv. (The other panel has a Rich Text Control). Now the Serialize throws a Nullpointer Exception on me. Unfortunately, the exception does not have any info what element is null here. How can I find the cause?
Best,
Martin
SIGN IN To post a reply.
14 Replies
1 reply marked as answer
VS
Vijayarasan Sivanandham
Syncfusion Team
May 3, 2021 04:52 PM UTC
Hi Martin Aupperle,
Thank you for contacting Syncfusion support.
Based on provided information we have checked the reported issue “Serialize throws Null pointer Exception” and unable to replicate the issue from our end. it is working fine as expected. Please find the tested sample and video demo from our end in the below link,
Sample link: https://www.syncfusion.com/downloads/support/forum/165041/ze/Sample-2141015409
Based on provided information we have checked the reported issue “Serialize throws Null pointer Exception” and unable to replicate the issue from our end. it is working fine as expected. Please find the tested sample and video demo from our end in the below link,
Sample link: https://www.syncfusion.com/downloads/support/forum/165041/ze/Sample-2141015409
Can you please share us below things?
1. Provide the replication procedure with video illustration of the reported issue
2. Provide the code snippet related customization in SfDataGrid
if you still facing the same issue? If yes, please modify the sample based on your scenario.
It will be helpful for us to check on it and provide you the solution at the earliest.
Regards,
Vijayarasan S
1. Provide the replication procedure with video illustration of the reported issue
2. Provide the code snippet related customization in SfDataGrid
if you still facing the same issue? If yes, please modify the sample based on your scenario.
It will be helpful for us to check on it and provide you the solution at the earliest.
Regards,
Vijayarasan S
SP
Sangavi Periyannan
Syncfusion Team
May 4, 2021 04:03 AM UTC
From: [email protected]
Sent: Monday, May 3, 2021 2:47 PM
To: Syncfusion Support <[email protected]>
Subject: AW: Syncfusion support community forum 165041, Serialize throws Nullpointer Exception, has been updated.
Sent: Monday, May 3, 2021 2:47 PM
To: Syncfusion Support <[email protected]>
Subject: AW: Syncfusion support community forum 165041, Serialize throws Nullpointer Exception, has been updated.
Hi Vijayarasan,
thank you for the material you sent to me. Unfortunately it is unrelated to the problem. The material shows how to use Datagrid, has some buttons, Serializes the grid etc. All this is working.
I wrote:
I used the Serialize/Deserialize functions of the datagrid with success.
... Until I have put the Grid in a Panel of the SplitContainerAdv.
Please note that it worked fine until I put the grid into a Splitter. When it is child of Panel1 of a SplizContainerAdv, it throws.
This is the code:
public void PersistProperties()
{
using (var file = File.Create( @"c:\tmp\DataGrid.xml") )
{
Grid.Serialize(file);
}
} // PersistProperties
Nothing special.
If necessary I can strip down the whole stuff to a solution that does nothing but produce the error. Please tell me if you need this, and provide an upload link.
Best,
Martin
SP
Sangavi Periyannan
Syncfusion Team
May 4, 2021 07:26 AM UTC
From: [email protected]
Sent: Tuesday, May 4, 2021 3:06 AM
To: Syncfusion Support <[email protected]>
Subject: AW: Syncfusion support community forum 165041, Serialize throws Nullpointer Exception, has been updated.
Sent: Tuesday, May 4, 2021 3:06 AM
To: Syncfusion Support <[email protected]>
Subject: AW: Syncfusion support community forum 165041, Serialize throws Nullpointer Exception, has been updated.
Yes. Serialize throws, but only if placed in Splitter.
VS
Vijayarasan Sivanandham
Syncfusion Team
May 4, 2021 04:30 PM UTC
Hi Martin Aupperle,
Thanks for the update.
Provided details are insufficient to find the exact cause for the issue. Can you please provide the more information related to your query?
Can you please share us below things?
Thanks for the update.
Provided details are insufficient to find the exact cause for the issue. Can you please provide the more information related to your query?
Can you please share us below things?
1. Provide replication procedure with video illustration of the reported issue
2. Provide the stack trace details of the exception occurred in your application.
3. Can you please provide your Syncfusion updated version?
4. If possible, kindly provide a simple issue reproducible
It will be helpful for us to check on it and provide you the solution at the earliest.
Regards,
Vijayarasan S
Regards,
Vijayarasan S
SP
Sangavi Periyannan
Syncfusion Team
May 5, 2021 05:16 AM UTC
From: [email protected]
Sent: Tuesday, May 4, 2021 2:52 PM
To: Syncfusion Support <[email protected]>
Subject: AW: Syncfusion support community forum 165041, Serialize throws Nullpointer Exception, has been updated.
Sent: Tuesday, May 4, 2021 2:52 PM
To: Syncfusion Support <[email protected]>
Subject: AW: Syncfusion support community forum 165041, Serialize throws Nullpointer Exception, has been updated.
OK then.
I have stripped down the project to the bare minimum, but left all UI-controls in their original state. I have attached all files zipped.
To reproduce the error, extract the 7zip to a directory, run the solution. Select menu item “Save all” from “Menu” :
Unsupported_File_Types_Alert
VS
Vijayarasan Sivanandham
Syncfusion Team
May 5, 2021 02:17 PM UTC
Hi Martin Aupperle,
Thanks for the update.
Based on provided information we have checked your attached sample in the previous update. We have extracted the attachment. This attachment does not contain the sample. Can you please share a sample with replication procedure video illustration of the reported issue?
Thanks for the update.
Based on provided information we have checked your attached sample in the previous update. We have extracted the attachment. This attachment does not contain the sample. Can you please share a sample with replication procedure video illustration of the reported issue?
It will be helpful for us to check on it and provide you the solution at the earliest.
Regards,
Vijayarasan S
Vijayarasan S
SP
Sangavi Periyannan
Syncfusion Team
May 6, 2021 05:26 AM UTC
From: [email protected]
Sent: Wednesday, May 5, 2021 12:16 PM
To: Syncfusion Support <[email protected]>
Subject: AW: Syncfusion support community forum 165041, Serialize throws Nullpointer Exception, has been updated.
To: Syncfusion Support <[email protected]>
Subject: AW: Syncfusion support community forum 165041, Serialize throws Nullpointer Exception, has been updated.
Hello,
I attached the zipped project to my email, but I got feedback from your server that it does not accept this file type.
How can I make available the files to you?
I have a server and I can send you a link where you can get them. Will this be OK?
Best,
Martin
VS
Vijayarasan Sivanandham
Syncfusion Team
May 9, 2021 04:19 PM UTC
Hi Martin Aupperle,
Thanks for the update.
You can create the incident under your direct trac account for SfDataGrid control and share the sample in that incident.
We will check the possibilities to achieve your requirement using any workarounds and update with further details.
Regards,
Vijayarasan S
MA
Martin Aupperle
May 10, 2021 11:35 AM UTC
OK, here is the solution to reproduce the problem.
Attachment: 02General__Copy_1c42afc5.7z
To reproduce, click in left menu and "Save All"
Attachment: 02General__Copy_1c42afc5.7z
VS
Vijayarasan Sivanandham
Syncfusion Team
May 11, 2021 04:29 PM UTC
Hi Martin Aupperle,
Thanks for the update.
We have checked the provided sample from our end. In your provided sample SerializationController set as null. So, null reference exception occurs. You can resolve the reported problem by remove the below mentioned line from your sample,
Thanks for the update.
We have checked the provided sample from our end. In your provided sample SerializationController set as null. So, null reference exception occurs. You can resolve the reported problem by remove the below mentioned line from your sample,
|
this.MainGrid.AccessibleName = "Table";
this.MainGrid.AllowResizingColumns = true;
this.MainGrid.AutoGenerateColumns = false;
this.MainGrid.Dock = System.Windows.Forms.DockStyle.Fill;
this.MainGrid.Location = new System.Drawing.Point(0, 0);
this.MainGrid.Name = "MainGrid";
this.MainGrid.SelectionMode = Syncfusion.WinForms.DataGrid.Enums.GridSelectionMode.SingleDeselect;
//resolve the reported problem by remove the below line
//this.MainGrid.SerializationController = null;
this.MainGrid.Size = new System.Drawing.Size(899, 300);
this.MainGrid.TabIndex = 0; |
Regards,
Vijayarasan S
SP
Sangavi Periyannan
Syncfusion Team
May 12, 2021 05:17 AM UTC
From: [email protected]
Sent: Tuesday, May 11, 2021 12:58 PM
To: Syncfusion Support <[email protected]>
Subject: AW: Syncfusion support community forum 165041, Serialize throws Nullpointer Exception, has been updated.
Sent: Tuesday, May 11, 2021 12:58 PM
To: Syncfusion Support <[email protected]>
Subject: AW: Syncfusion support community forum 165041, Serialize throws Nullpointer Exception, has been updated.
Thank you very much!!!!!
I did not bother with the designer-generated code. How come that the Winforms-Designer in VS 2019 put this in? What can be the use of setting it to null?
Best,
Martin
VS
Vijayarasan Sivanandham
Syncfusion Team
May 12, 2021 06:43 PM UTC
Hi Martin Aupperle,
Thanks for the update.
Based on provided information we have checked the reported problem from our end. In Designer drag drop the SfDataGrid into SplitterContainerAdv. In this case SerializationController code not generated. There is no use in set the null value in SerializationController in SfDataGrid.
Please let us know if you have any concerns in this.
Thanks for the update.
Based on provided information we have checked the reported problem from our end. In Designer drag drop the SfDataGrid into SplitterContainerAdv. In this case SerializationController code not generated. There is no use in set the null value in SerializationController in SfDataGrid.
Please let us know if you have any concerns in this.
Regards,
Vijayarasan S
Marked as answer
MA
Martin Aupperle
May 13, 2021 03:06 PM UTC
Interesting!
I definitely did not set the SerializationController to null. I did not even know what this was! And if I HAD set it explicitly, I would have known what the problem was with the nullpointer exception in Serialization.
Maybe the problem came because the grid was in the Form itself at first, and only later I added the Splitter in between. It is a proof of concept project, and things change all the time. I am trying to get acquainted with Syncfusion UI-Elements for WinForms. Maybe the WinForms-Designer got a hiccup here.
Anyway, the problem is solved, and the case can be closed. Thank you for your help!
Best,
Martin
SJ
Sathiyathanam Jeyakumar
Syncfusion Team
May 14, 2021 08:20 AM UTC
Hi Martin,
Thanks for the update.
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you😊.
Regards,
Sathiyathanam
SIGN IN To post a reply.
- 14 Replies
- 4 Participants
- Marked answer
-
MA Martin Aupperle
- Apr 30, 2021 04:48 PM UTC
- May 14, 2021 08:20 AM UTC