c1List.c1Combo how to correctly refresh DataSource

Posted by: softcomlimited on 10 March 2020, 2:18 pm EST

    • Post Options:
    • Link

    Posted 10 March 2020, 2:18 pm EST

    Hello,

    I have a combo that I set the datasource = datatable and then set the .Splits(0).DisplayColumns(“colname”) the way I want.

    
     With c1cboVendor
            .ClearFields()
            .DataSource = GetVendorListDT()
            .DataMember = "VendorID"
            .DisplayMember = "VendorName"
    	.Splits(0).DisplayColumns("VendorName").Width = 180
            .Splits(0).DisplayColumns("Address1").Width = 120
    End With
    
    

    I do this by calling a method in my form_load event.

    After this I want to reload with a refreshed datatable (new rows added).

    I reuse the similar process as before and call the same method. Except this time I get an error because there is no Splits(0).

    I don’t understand why.

    version 4.0.20151.38

    Regards

    Brian

  • Posted 11 March 2020, 5:01 am EST

    Hi Brian,

    Sorry but we can not replicate the issue at our end and we are not getting any error.

    Please find the attached sample which is working fine at our end and modify it accordingly replicating the issue.

    Note: When again assigning the DataSoruce to C1Combo, first set its DataSource to Nothing then assign the new DataSource.

    Regards,

    Prabhat

    C1ComboDemo1.zip

  • Posted 11 March 2020, 8:21 am EST

    Mr Sharma,

    I disagree, actually you can replicate the issue but the solution is to do .DataSource = Nothing first.

    Oddly I have not had the issue with the c1flexgrid which I use much more commonly but I will see if it is benign and just do it as a matter of course.

    Thanks so much again

    Brian

Need extra support?

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

Learn More

Forum Channels