This is a migrated thread and some comments may be shown as answers.

GridView Column Click Sort Error : NullReferenceException

9 Answers 240 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
Psyduck asked on 17 Dec 2020, 07:07 AM

Hello. I used the sample provided by the SDK. (GridView - Group Selecction)

There was a problem with group sorting.

 

Please check the image for details.

 

 

In sdk Source (MyBehavior.cs) ======================================

private IEnumerable<object> GetSubGroupItems(IGroup gr)
{
if (!gr.HasSubgroups)   ★ <<<< This alert  (System.NullReferenceException: Object reference not set to an instance of an object.)
{
return gr.Items.OfType<object>();
}
else
{
List<object> items = new List<object>();
foreach (var subGr in gr.Subgroups)
{
items.AddRange(GetSubGroupItems(subGr));
}
return items;
}
}

========================================================================================

 

I want to sort by header group. Could you solve it?

Thanks.

 

9 Answers, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 21 Dec 2020, 11:02 AM

Hi KIM,

Thank you for the provided information.

I have double-checked the reported exception but wasn't able to reproduce it in the mentioned example. Can you confirm that you haven't made any changes to the project? If no, can you share what modifications are made so I can try to reproduce it on my side. Also, which version of our DLLs are referenced to the project?

Regards,
Dinko
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products, quickly just got a fresh new look + new and improved content, including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
answered on 22 Dec 2020, 01:46 AM

Hello.

I haven't modified the project.

 

Telerik version is 2020.3.915.40

References(Telerik = 5) : Telerik.Windows.Controls, GridView, Input, Data  

SDK settings are like this.

1. C:\Program Files (x86)\Progress\Telerik UI for WPF R3 2020\Binaries\WPF40

2. C:\Program Files (x86)\Progress\Telerik UI for WPF R3 2020\Binaries.NoXaml\WPF40

3. C:\Users\jskim\Documents\xaml-sdk

 

When just RUN in SDK, click the sort button and the window will just close.

That error is an error that appears when debugging in code.

 

When you click the sort button in your environment, the window does not close and there are no errors?

 

Thanks.

 

 

0
Dinko | Tech Support Engineer
Telerik team
answered on 24 Dec 2020, 02:38 PM

Hello KIM,

Thank you for the provided details.

I have tested the example in our SDK browser with the mentioned version, and you are right that the application crash. However, I have tested it with our LIB version, and the example is working as expected. You can download the lib version of our DLLs directly from your account.

Give it a try and let me know how it goes.

Regards,
Dinko
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products, quickly just got a fresh new look + new and improved content, including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
answered on 29 Dec 2020, 02:33 AM

Hi. Dinko.

 

I changed the version of the DLLs to 2020_3_1221, the latest internal build version, and confirmed that there is no problem.

I use noXaml, but there is no Xaml in version 2020_3_1221. Is it okay to continue using the 2020_3_915 WPF40 version of Xaml?

Do you have any problems using this?

0
Martin Ivanov
Telerik team
answered on 30 Dec 2020, 03:06 PM

Hello KIM,

It is not necessary to use the NoXaml version of the controls. The Xaml one contains the same features and controls. The only difference is that the NoXaml requires a bit more effort to set it up and also it supports runtime changes of the theme. You can use whatever set of dlls you prefer - Xaml or NoXaml.

Also, the LIB (latest internal build) version contains both Xaml and NoXaml dlls. Can you double check this on your side? If the dlls are still not there, can you tell me how do you download the LIB?

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
answered on 04 Jan 2021, 01:56 AM

Hello Martin,

 

Not a problem for Dlls. Dlls contains both Xaml and NoXaml.

There seems to be a misunderstanding.

It was just a problem with the theme *.xaml when using NoXaml.

 

Thanks you.

0
Martin Ivanov
Telerik team
answered on 06 Jan 2021, 10:38 AM

Hello KIM,

Can you tell me what do you mean by saying that there is a problem with the theme *.xaml when using NoXaml? What is the exact problem?

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
answered on 07 Jan 2021, 01:28 AM

I'm not a native English speaker, sorry.

I use the Dlls version 2020_3_1221. In this version, there are Xaml and NoXaml versions. But there is no theme(*.xaml).

The theme uses the folder path(...\Progress\Telerik UI for WPF R3 2020\Themes.Implicit\WPF40\ *.xaml) of telerik version 2020.3.915.40.

I am curious if there is any problem with using it like this.

 

Thanks

 

 

 

1
Accepted
Martin Ivanov
Telerik team
answered on 11 Jan 2021, 01:49 PM

Hello KIM,

Thank you for the clarification. The LIB releases also contain the .xaml files. They are located in the "Theme.Implicit" folder in directory where the archive is unzipped (see the attached image). I've double checked the file uploaded in the telerik.com system and I can confirm that it contains the .xaml file. 

About using .xaml files from a different version of Telerik UI for WPF (like 2020.3.915 in your case), this is not recommended. There are minor changes through the releases and we cannot guarantee that a .xaml file from one version will work properly in another version. If you want to avoid copying .xaml files on each update I would suggest you to use the theme dll instead of copying the .xaml files. This approach is described in the Setting a Theme article. 

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
GridView
Asked by
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
Answers by
Dinko | Tech Support Engineer
Telerik team
Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
Martin Ivanov
Telerik team
Share this question
or