Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2515
Using Combobox with grid, but with different dropdown values based on current row
posted

We need to use Comboboxes in an iggrid. However, depending upon the row/cell that is currently being edited, we would like to control the contents available in the dropdown for selection. Is there a way to refresh the contents that display in the dropdown dynamically.

Here is what I'm proposing and need to know if it can be done.

The datasource used to populate the combobox dropdown will include all possible values that we would want to see in the dropdown. When a row/cell is clicked and goes into edit mode, we use another hidden value in the row, for example ComboId, to filter the contents of the dropdown before it gets displayed, limiting the values available for that specific row/cell. However, clicking a different row for the same column would permit displaying a different list of values in the combobox dropdown. So a single combobox is used having a single, unchanging datasource, but the visible list if filtered depending upon the row selected.

Is there a way to do this within the constraints of the iggrid, or are there other options that can be suggested?

Thank you.

  • 5513
    Verified Answer
    Offline posted

    Hello,

    Changing the data sources will most likely be the best solution in this case. Since igCombo uses filtering internally, it will for example clear the filter applied by 'ComboId' in the case of editable combo, when the end-user clears the input field. Additionally igCombo's filter proxy function doesn't allow for filtering on an arbitrary field in the combo's data source which means the required filtering needs to be done directly on its igDataSource instance and igCombo will have to be notified of that using an internal function.

    With these said, I am attaching a sample using filtering to achieve the scenario but it will only work for mode "dropdown", while "editable" should be implemented by changing the data source of the combo.

    I hope this helps! Thank you for using Infragistics products!

    Best regards,

    Stamen Stoychev

    filterComboDS.zip