GridView Column Click Sort Error : NullReferenceException

10 posts, 0 answers
  1. KIM
    KIM avatar
    48 posts
    Member since:
    Jul 2020

    Posted 17 Dec 2020 Link to this post

    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.

     

  2. Dinko
    Admin
    Dinko avatar
    1259 posts

    Posted 21 Dec 2020 Link to this post

    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/.

  3. KIM
    KIM avatar
    48 posts
    Member since:
    Jul 2020

    Posted 21 Dec 2020 in reply to Dinko Link to this post

    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.

     

     

  4. Dinko
    Admin
    Dinko avatar
    1259 posts

    Posted 24 Dec 2020 Link to this post

    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/.

  5. KIM
    KIM avatar
    48 posts
    Member since:
    Jul 2020

    Posted 28 Dec 2020 in reply to Dinko Link to this post

    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?

  6. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2647 posts

    Posted 30 Dec 2020 Link to this post

    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/.

  7. KIM
    KIM avatar
    48 posts
    Member since:
    Jul 2020

    Posted 03 Jan in reply to Martin Ivanov Link to this post

    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.

  8. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2647 posts

    Posted 06 Jan Link to this post

    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/.

  9. KIM
    KIM avatar
    48 posts
    Member since:
    Jul 2020

    Posted 06 Jan in reply to Martin Ivanov Link to this post

    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

     

     

     

  10. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2647 posts

    Posted 11 Jan Link to this post

    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/.

Back to Top