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
405
Communication between IGgrids and IGgrid elements
posted

The Problem we are facing:
Whenever we change something inside an IGgrid, we have to reload the whole website to communicate the changed state to all other IGgrids relating to that IGgrid we just changed. 

We want to create a way to communicate data changes from one IGgrid to the other in the .cshtml and C# (MVC) context of the View. 
More specifically: IGgrid A adds/deletes/changes one of its rows. And it so happens, that a second IGgrid B uses these rows as a selection in a dropdown combobox when creating a new row in IGgrid B. 
How can IGgrid A inform IGgrid B's combobox, to update its unrelated combobox values to represent the new state of IGgrid A without reloading the website? 

What we found so far:
We found a way to change data and rebind the data specifically via JavaScript only and via an external function (as attached to this post).
Now here are the problems with that:

1. They use JavaScript entirely but we are reyling on the C# (MVC) context to create our IGgrids in the View. How can we create the same effect as seen in the example within the C# context of the View?
2. They use an old version of IGgrid and the infragicstics API and it doesn't seem to work in newer versions (2015 onwards). We are using a newer version from 2015.
3. The data type used to represent the dropdown combobox values is a simple array of numbers. How can we do this with a more complex data type like a C# (MVC) list or C# (MVC) dictionary?

What we got:
We use the Entity Framework as well, to manage data in the backend on the server side. But this problem mostly concerns the client side. On the client side, we use dataSource(ViewBag.data) for a combobox to get data from the controller. This works fine until changes occur without reloading the site, so this seems to be a no-go.
 
What we need:
A way to accomplish said problem with the IGgrid of the 2015 infragistics API. 

RebindProviderCorrect.zip
Parents Reply
  • 18204
    Verified Answer
    Offline posted in reply to Stanislas Mauser

    Hi Stanislas Mauser,

    To update the combo's data, you should only have to call dataBind on it.  This will have the igCombo fetch the data from its dataSource URL.  This is assuming you have already updated the datasource on the server.  If you haven't updated the datasource on the server yet, no new data will be returned.

    I have attached a simple MVC sample to demonstrate this.  In my sample, I add a new Category each time the igCombo's dataSource is requested from the server.  The first time you open the Category dropdown, you will see Category 1001 on the end.  Then each time you click "Update Combo" a new Category will be added.

    Please note that I have just discovered that an exception is thrown when calling dataBind while using IE11 which prevents the igCombo from updating, but this works in Chrome and Firefox.  I have logged this in our tracking system with ID: 205346.

    I have created a support case for you with an ID of CAS-159688-K9R3F3.  You can view the status of the development issue connected to this case by going to the “Account” tab on our website, selecting "My Support Activity" and then this support case will be listed there.  Then, you may select the "Development Issues" tab to view details of this development issue.

    Please let me know if you have any further questions with this.

    igGrid_ComboDataUrl.zip
Children
No Data