This is a migrated thread and some comments may be shown as answers.

Trigger WebService Loading via Client API?

1 Answer 61 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Joel Kraft
Top achievements
Rank 2
Joel Kraft asked on 24 Jan 2018, 05:13 AM

I have a RadDropDownList in a TemplateColumn of a RadGrid. The grid is using batch editing mode, and the drop-down list is loading its data from a web service.

This is all generally working, except for the fact that the DDL does not load it's items until the first time you click on the control. Unfortunately, that is a tad too late for the existing value to be retained the first time that it is used. Editing subsequent rows is fine.

So, I'd like to cause the DDL to load it's items earlier. Is there a way to trigger the RadDropDownList to dynamically load it's list on demand??


1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 26 Jan 2018, 04:47 PM

Hi Joel,

I just answered your support ticket with this question and I am pasting this here for anyone else having the same situation.

------

The main problem with this is that the grid will get the current text of the cell and attempt to set it for the editor (in this case - the dropdown list). So, if the dropdownlist does not contain an item with said text, you will get an error.

The virtual scrolling of the RadDropDownList performs an initial request when the control gets initialized on the client and the number of items it will fetch is controlled via the ItemCountPerRequest property. Unfortunately, there is no method to trigger this loading programmatically, as its internal logic relies on the scrolling which is a user action.

Thus, if you set that property to a large enough value and can be sure that all data in the current grid will be present in the provided data set, you could try using such load-on-demand.

I must note, however, that the batch editing mode does not support it.

Nevertheless, I am attaching a small sample that illustrates this approach and potential issue.

 

 

Regards,

 

Marin Bratanov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
DropDownList
Asked by
Joel Kraft
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
Share this question
or