We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Dynamically loading GridMultiColumnDropDownList itemsource based on value selected in another column of the row.

Hi Team,

I am trying to achieve the following using sfDataGrid and GridMultiColumnDropDownList type columns.
I have shipping information displayed in a sfDataGrid, which have a few columns among them are Country and City which need to be GridMultiColumnDropDownList.

There is a master list of country/city which is used as look up for Country and City. Based on the country selected the itesm in the city should be filtered and show when the user is on City column. But once I select the country the master list is filtered for relavent City, but does not show when i try to open the City multicolumn drop down.

No sure if i am missing something. Please help. Let me know if you need more information.
Attached in the sample.

Thank you.


Attachment: WPF_480f8dd2.zip

10 Replies

SA Saravanan Ayyanar Syncfusion Team January 29, 2020 06:16 PM UTC

Hi Srikanth Vattipally, 
 
Thank you for contacting Syncfusion support. 
 
Currently, we are analyzing your reported scenarios. We will validate and update you the details on or before 31st January 2020.  
 
We appreciate your patience until then. 
 
Regards,
Saravanan A.
 



SA Saravanan Ayyanar Syncfusion Team January 31, 2020 01:03 PM UTC

Hi Srikanth Vattipally, 
 
Thank you for your patience. 
 
We can replicate your reported issue “ Once opened the  Country MultiColumnDropDownListColumn, after open the City MultiColumnDropDownListColumn, the City column drop down is empty” from our end. Currently we are checking the feasibility to resolve the same. We will validate and update you the details on 3rd February 2020. 
 
We appreciate your patience until then. 
 
Regards, 
Saravanan A. 
 



SS Susmitha Sundar Syncfusion Team February 3, 2020 01:40 PM UTC

Hi Srikanth  
   
Sorry for the inconvenience caused.   
   
We did not find the exact root cause for your reported issue. Currently, we are checking the feasibility to resolve the reported issue. We will validate and update you with complete details on or before February 5, 2010. 
 
We appreciate your patience until then.   
   
Regards,   
Susmitha S   
 



SA Saravanan Ayyanar Syncfusion Team February 5, 2020 12:51 PM UTC

Hi Srikanth Vattipally, 
 
Thank you for your patience. 
 
We can replicate the reported issue and created the bug report for the same. Can you please specify your current Syncfusion version so that We will provide a patch for that version 
 
Regards, 
Saravanan A. 



SV Srikanth Vattipally February 6, 2020 01:35 PM UTC

Hi Saravanan,

Thank you for the updates. We are currently using the version 17.3.0.19

Could you also let me know when the fix will be available as part of standard release, so that we can plan accordingly in case we want to update to the latest version.

Let me know if you need for information.


Thanks,
Srikanth V.


FP Farjana Parveen Ayubb Syncfusion Team February 7, 2020 01:27 PM UTC

Hi Srikanth, 
 
Thank you for your update. 
 
You are using the NuGet version, we didn’t provide the patch for NuGet versions. So, we will fix the reported issue and include in our 18 February 2020 weekly NuGet. 
 
Please find the below feedback link 
 
We appreciate your patience until then 
 
Regards, 
Farjana Parveen A 



SS Susmitha Sundar Syncfusion Team February 18, 2020 02:02 PM UTC

Hi Srikanth, 
 
Sorry for the inconvenience caused. 
 
We did not include your reported issue in our weekly NuGet release.  We will include this fix in our 25th February 2020 weekly NuGet without fail. Until, we request to use our below workaround for this. 
 
C#: 
  sfdatagrid.CellRenderers.Remove("MultiColumnDropDown"); 
  sfdatagrid.CellRenderers.Add("MultiColumnDropDown", new GridCellMultiColumnDropDownRendererExt()); 
 
 
  public class GridCellMultiColumnDropDownRendererExt : GridCellMultiColumnDropDownRenderer 
  { 
      public GridCellMultiColumnDropDownRendererExt() 
      { 
          this.IsDropDownable = true; 
          this.AllowRecycle = false; 
      } 
  } 
 
public class ItemsSourceSelector : IItemsSourceSelector 
{ 
    public IEnumerable GetItemsSource(object record, object dataContext) 
    { 
        if (record == null) 
            return null; 
 
        var orderinfo = record as OrderDetails; 
        var countryName = orderinfo.ShipCountry; 
 
        var viewModel = dataContext as ViewModel; 
 
        //Returns ShipCity collection based on ShipCountry. 
        if (viewModel.ShipCities.ContainsKey(countryName)) 
        { 
            ObservableCollection<ShipCityDetails> shipCities = null; 
            viewModel.ShipCities.TryGetValue(countryName, out shipCities); 
            return shipCities; 
        } 
        return null; 
    } 
} 
 
In this sample, we have overridden the GridCellmultiColumnDropDownRender and Set the AllowRecycle property as false. And you can use the ItemsSourceSelector for load the items based on property value. 
 
 
 
Please let us know if you need further assistance on this. 
 
Regards,
Susmitha S
 



SS Susmitha Sundar Syncfusion Team February 25, 2020 01:20 PM UTC

  
Hi Srikanth, 
We have fixed the mentioned issue “Data not populated when opening second GridMultiColumnDropDownList column” and included the issue fix in our weekly NuGet update version 17.4.0.51 which is available for download (nuget.org).  
We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you would require any further assistance. 
Regards, 
Susmitha S 



SV Srikanth Vattipally March 16, 2020 03:14 PM UTC

Hi Team,

Thank you for the support, but I still cannot get it working like the way I intend it to work.
I am still not able to get cities filtered based on the country selected. Once I select a country, I am filtering the source and binding this refreshed/changed property (itemsource ) to multicolumndropdown. Though there is data in this property CountrySpecificShipping it still does not show in the UI.

I have updated the Nuget packges to the latest not sure if there is a control property that I am missing. Attached is the sample.
Steps to replicate the issue:
1. Load the application. (with the latest syncfusion nuget packages)
2. Change the country to Canada in Country column. 
3. Since Canada has 2 cities in the master data and CountrySpecificShipping is binded to the column ShipCity, I expected 2 rows of data with Montreal and Quebec should be displayed when combobox ShipCity is open. 

Let me know if you need further information or if I am missing something.


Thanks,
Srikanth V.

Attachment: WPF_4b7ac11b.zip


SS Susmitha Sundar Syncfusion Team March 17, 2020 11:36 AM UTC

  
Hi Srikanth, 

Thank you for the update. 

We could able to replicate your reported issue. In your sample, you are binding the CountrySpecificCollection which is defined in Model class for GridMultiColumnDropDownList’s ItemsSource. It's not the correct approach. We suggest that use the GridMultiColumnDropDownList.ItemsSouceSelector support to achieve your requirement. Please refer to the below link, 


Please let us know if you need further assistance on this. 

Regards, 
Susmitha S 


Loader.
Live Chat Icon For mobile
Up arrow icon