Upgrade 4.8.1 to DotNet6/7

Posted by: james on 9 October 2023, 8:53 pm EST

  • Posted 9 October 2023, 8:53 pm EST

    I recently took the plunge to upgrade our massive solution that has been developed for 15 years from 4.8.1 to DotNet7.

    I came across several problems, so I was hoping to list a couple here to get your input and hopefully a way forward:

    C1FlexGridSearchPanel

    I cannot seem to find a replacement for the Flex Grid search panel. Can you please confirm I am not overlooking something? If it does not exist anymore, what do you recommend instead?

    C1DataSource

    There does not appear to be a replacement for the C1DataSource, and LiveLinq. What should I move to?

    C1DropDownControl

    We have extended the C1DropDownControl class to make our own custom dropdown. There appears to be an updated version of C1DropDownControl, but it does not have the same features. For example, base.DropDownForm, base.TextDetached are missing. There is a base.Form instead which implements the IDropDownForm interface, but it is read only. Any ideas?

    There were a several other things that I came across, but most issues I resolved. The above appear to be my main issues so far.

    Thanks

  • Posted 10 October 2023, 6:19 am EST

    Hi James,

    1. C1FlexGridSearchPanel: C1FlexGridSearchPanel is not available in Net6 version. However, there’s a way to achieve this requirement. You can add a UserControl and implement the SearchPanel for the FlexFrid.

      Please refer the attached sample for the same: CustomSearchPanel_Fg.zip

    2. C1DataSource: C1DataSource is not available in .Net6. If you want to use C1DataSource for your .Net6 application. Then you can explore C1DataService components. Please refer here: https://www.grapecity.com/componentone/docs/services

      C1DataService is fast and rich in data collection features.

      Note:- It needs different licensing. It is considered in Data Service Edition, Winforms DataService Edition, and ComponentOne Studio Enterprise licenses.

      For more information: https://www.grapecity.com/pricing

    3. C1DropDownControl: DropDown control has CreateDropDownForm method to create a DropDownForm.

      C1DropDown doesn’t inherit C1TextBox. Hence, it doesn’t have the TextDetached method. Could you please provide your use case? So, that we can provide a solution to achieve your requirement.

    Best Regards,

    Nitin

  • Posted 11 October 2023, 3:32 am EST

    1. It’s a custom drop down that displays a user control we created. It allows the user to filter and select a certain option, which then closes the dropdown and displays the result in the box.

      In 4.8.1, we have extended the C1.Win.C1Input.C1DropDownControl class, and in the constructor we set base.DropDownForm to an instance of a class where we have extended C1.Win.C1Input.DropDownForm.

      In other words, we have a class that extends C1.Win.C1Input.C1DropDownControl, and a class that extends C1.Win.C1Input.DropDownForm.

      In the new paradigm, do we implement IDropDownForm instead of extending DropDownForm? Our user control is heavily integrated into our application, but if required I can make a sample application and cut out all the links to our main application so that you have something to work with.

    If it is any help, I’ve attached a zip (DropDown.zip) of the classes.

    1. We have studio enterprise so DataServices are covered, but are you able to provide a bit more of an insight please.

      Funnily enough, the only place we use the C1DataSource is the control we use on the custom drop down form. We point the C1DataSource to an entity framework db context, and use virtual mode on the ViewSources, along with LiveLinq in the implementation.

    If it helps, I’ve attached a zip of the file that uses the data source.

    1. Thanks for this, and I’ll have a play with the sample you provided and let you know how it goes.

      .

      .

      DropDown.zip

      UCClientSelectorV2.zip
  • Posted 12 October 2023, 3:28 am EST

    Hi,

    1. Thanks for the acknowledgement. Please let us know if you face any issues with it.

    2. If you have the Studio Enterprise license. Then you can use DataServices. As per your requirement, you can follow this article to connect your EntityFramework DbContext : https://www.grapecity.com/componentone/docs/services/online-dataconnector/jsonentityframework.html and https://www.grapecity.com/componentone/docs/services/online-dataconnector/jsonlinq.html.

    3. As we mentioned, DropDownForm property is not available in the .Net6 C1DropDownControl. But it has CreateDropDownForm() method. You can override it to create your own form.

      For TextDetached Method, it is removed in .Net6 because it doesn’t inherit C1TextBox now.

      If your requirement is to have different Text and Value. Then you can try Tag property instead. So, that you can differentiate the values. Due to design behavior, the text and Value can’t be differentiated. But you can make use of Tag property.

    Please refer the attached sample for the implementation: DropDownApp.zip

    Best Regards,

    Nitin

  • Posted 12 October 2023, 9:29 pm EST

    Thanks for the prompt reply.

    1. It worked great, I only had to make a slight modification to accept “enter” to trigger a search.

    2. Thanks. I had a bit of a play with VirtualModeDataCollection and passed through the dbcontext directly. Is there any way to connect to a DataSet/TableAdapters(SQL) instead, which is what we use for the majority of our application? Or if I want to use features such as VirtualMode it needs to be EntityFramework?

      I’ve had a look at the C1DataCollection101 samples, but do you know if there are any more samples? I think I have more to learn here, as I am still a bit confused.

    I was able to use the VirtualMode sample and modify it to use a dbcontext directly in the GetPageAsync override method. I am just trying to figure out filters now.

    From what you have posted, it appears I should be using a DataConnector first, and then a DataCollection? Currently, we want to have flexgrid with data from an sql table in virtual mode that is filterable. We are using EntityFramework and a c1datasource at the moment, but it’s the only thing we use EntityFramework for, so if we can use our DataSet/TableAdapters instead that would be handy, but virtual mode would be very handy!

    1. Thanks for the sample, I’ll see if I can modify it to our requirements.
  • Posted 16 October 2023, 12:26 am EST

    Hi,

    Apologize for the delay.

    1. Thanks for the acknowledgement.
    2. There is no compulsion to use EntityFramework with VirtualMode. Apologize but we have a limited number of samples for the Dataservices. We are trying to add more samples to showcase DataServices features.

      The filter is not supported in VirtualMode. This is a known issue and it is already reported to the development team. They are working on it. We will let you know once they fix this issue.[Internal Tracking Id - C1WIN-29291]

      DataConnectors and DataCollection: If you want to make connectivity with data providers such as: Google Analytics, Salesforce, JSON, Kintone, etc Then you need to use DataConnectors. If you need to work with DataSet or Sql, then you can implement DataCollecton.

      We are trying to create a sample for you to achieve your requirements. Will provide it to you once we are done with the sample.
    3. Once you test this please let us know if anything you are not able to achieve with the DropDown.

    Regards,

    Nitin

  • Posted 16 October 2023, 4:01 am EST

    1. No problem.
    2. Thanks for this, and I’d love to see the sample. Yes, I did feel as if the current samples were rather limited.

      I was able to hack my way around the filters, and got it working quite well by adding & modifying a query object on my VirtualModeDataCollection extended class.

      If you could provide your sample when ready in regards to .Net DataSet/TableAdapters/MSSQL that would be great!
    3. Will do.
  • Posted 14 November 2023, 7:42 am EST

    Hi James,

    Apologize for the delay.

    We are working on the sample. Will let you know once we are done with the sample.

    Regards,

    Nitin

  • Posted 17 November 2023, 1:52 am EST

    Hi Nitin

    Thanks for the update.

    James

  • Posted 1 December 2023, 7:53 am EST

    Hi,

    Apologize for the delay.

    Here’s the sample to achieve virtualization with DataSet or Object Model.

    Please refer the attached sample for the same: LoadInDemandDemo.zip

    Best Regards,

    Nitin

  • Posted 6 December 2023, 3:48 am EST

    Hi Nitin

    That’s great, thanks! I’ll check out the sample.

    Kind Regards

    James

  • Posted 3 February 2025, 1:56 am EST

    I’ve gone ahead and changed over to the new paradigm for the C1DropDownControl in following through with your instruction and sample and modifying our old code.

    I’ve come across a problem where I cannot seem to find where to set the DropDown height.

    Previously, it used the width and height of the DropDownForm, but it does not seem to use that anymore.

    I did find .DropDownWidth as part of the C1DropDownControl - this works for the width of the dropdown, but there is no DropDownHeight property.

    Can you please advice.

    Thanks

    James

  • Posted 4 February 2025, 3:11 am EST

    Hi James,

    By default, the C1DropDownControl determines the dropdown’s height based on the height of the hosted control. Therefore, you can set the height of the hosted control instead.

    Please refer to the attached sample project for reference: InputDropDownSize.zip

    Best Regards,

    Kartik

  • Posted 4 February 2025, 8:13 pm EST

    Hi Kartik

    Thanks for this sample, I’ll have a deep dive hopefully this afternoon - but just looking on the surface it appears quite different than the sample provided by Nitin which extends C1DropDownControl and DropDownForm, overriding CreateDropDownForm.

    Are you able to advise?

    Is there documentation on its usage?

    Because the sample provided by Nitin which uses the extension of C1DropDownControl does not automatically size the height for the hosted control.

    Our legacy code heavily extends and has a lot of custom stuff - hopefully which will be able to come across with the new way of doing things.

    I’ll have a play later on.

    Thanks

    Kind Regards

    James

  • Posted 5 February 2025, 3:47 am EST

    Hi James,

    The approach suggested by Nitin earlier is applicable when implementing a custom DropDownForm within the dropdown. This method aligns with the .NET Framework 4.8 architecture of C1DropDownControl, where a Form was used in the dropdown.

    However, the .NET 6+ version of C1DropDownControl is architecturally different. It provides a Control property, allowing you to directly assign a UserControl as the hosted dropdown content (as demonstrated in the sample I shared). This approach simplifies implementation and offers more flexibility for customizing the hosted UserControl.

    We observed that in the first implementation (DropDownForm inheritance), changing the form’s height does not take effect. While we recommend using the Control property (from the new architecture), if you prefer the DropDownForm approach, please let us know, and we will investigate further on this.

    Best Regards,

    Kartik

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels