I've been using Winforms Infragistics controls for years and I'm now moving onto using the IgniteUI controls for some web apps we're developing. I'm new to the web side of things so I'm struggling to find examples and understand what I need to do (programmatically) to achieve my objectives.
I've attached sample code to support the following.
I have a grid with the DataSourceUrl set to "/Home/GetCompartmentData/". It loads the grid fine.
I have 4 combos:
The Species combo displays two columns. There are an additional 2 columns hidden that relate to the other combos.
Species data model:
When you click on the YM combo it should filter to the YMSpecies of the selected Species. The YM data model has a Species field to filter on.
When you click on the YC combo it should filter to the YMId of the selected YM. The YC data model has a YMId field to filter on.
When you click on the PS combo it should filter to the PSSpecies of the selected Species. The PS data model has a Species field to filter on.
If you could look at my example and help me out with understanding what I'm missing/need to do that would be fantastic!
In my final solution I will have 8 combos. The 4 I list here relate to "current crop" of the underlining dataset and the other 4 (not listed), which are a duplicate set of data (ie have Species, YM, YC and SP) relate to the "successor crop".
The grid's data could be from 1 to 1700 rows. The Species combo has 100 rows, YM 170 rows (unfiltered), YC 840 rows (unfiltered) and PS 70 rows (unfiltered). This is why I'd prefer to serve the data remotely.
I'm using IG 2017.1 with VS2107.
Edit: I'm unable to attach the zip file. Is there a file size limit? It's approx 25mb.
Thank you for posting in our forums!
The forums have a 20MB file size limit. You shouldn't need to include any assemblies if your project has a packages.config.
Try to isolate and limit your sample to only the parts needed to reproduce the issue. This will help to narrow down the issue and decrease the file size.
If you still cannot decrease the file size any further, you may email the sample to email@example.com. If so, please mention case #CAS-188035-H1Q5N5 in the subject of the email.
Looking forward to hearing from you.
It's funny how the size shrinks when you remove the packages! :)
Please find attached the sample as described in my opening post.
I've attached a modified version of your sample with the code that would be required. I handle the dropDownOpening event of the ComboEditors to accomplish this.
Here are the changes I've made:
- Removed DataSourceUrl for YMId, YCId, PSId combo editors.- Added event handlers for the above editors.- ComboDataSourceActions in the controller now accept a cascade key and returns results filtered by this key.- Added a Hidden column for the PrimaryKey. (this is required for the grid's data schema to be set up correctly)
The combo editors have their data source when the
Currently, the data is fetched each time the drop downs are opened. Some additional code can be added to prevent the data request to not be sent if the parent combo has not changed, but I will leave that for you to implement if you need to.
If you have any further questions or concerns with this, please let me know.
Thanks Michael, that's very helpful. I should be able to wire that in now.
What can I do about:
For showing the display value of the combo, you should handle the column's FormatterFunction to set up a function that retrieves the value from the combo and returns it as the cell's display text. You can see a simple example of this in this online sample.
For the values not showing initially, I need some more time to investigate this and discuss this with the other dev teams. I will have more information or questions for you by Tuesday.