I thought this was one of the most straightforward services offered by this component, but it comes out it is a very tough functionality, to offer.
So, to recap, what is a lookup combobox?
We have a model in input, where there is some sort of id (for example, int? IDProduct, for a table in the database where I have Products(ID, Name): it is nullable because the db field can be non-mandatory, of course).
If we are editing a new record, the value in the model is obviously missing, while if I'm editing a record, the field can or cannot have a specific value.
When showing the combo in the page, if the backing model has a value for the id, we would like to show the corresponding description of the product, otherwise the combo is void.
In each case, when we start typing in the field, after the specified number of chars, a search on the server is started to show the dropdown with the corresponding records.
We select one of the items, so fixing the whole text in the combo and recording a new value for the backing IDProduct (for example, in an observable object, or directly inside the control), and when we submit the page, we send the value to the server.
Lookup comboboxes have always existed in every good user interface library for handling db data, but, for what I could read, study, and try, it's not easily done with this component.
There are the datasource, the transport, the additionaldata, filter parameters, autobind true or false, the binding of a numeric value that becomes initially also the text shown in the combo, since there are not still values in the inner cache, and so on...
I opened tickets, and solved problems one at a time, but in each case, I fixed a problem just to open another, never closing the gap to obtain a really functioning solution.
Is there anyone who wrote some *real* code that can help me, with this problem?
I find very strange that Telerik didn't make a complete sample for this behaviour, that is *really* one of the basic, and most needed, functionalities for a component like this?
Or am I missing something really important???
Please help me, I'm tired and stuck... :-(
Andrea
So, to recap, what is a lookup combobox?
We have a model in input, where there is some sort of id (for example, int? IDProduct, for a table in the database where I have Products(ID, Name): it is nullable because the db field can be non-mandatory, of course).
If we are editing a new record, the value in the model is obviously missing, while if I'm editing a record, the field can or cannot have a specific value.
When showing the combo in the page, if the backing model has a value for the id, we would like to show the corresponding description of the product, otherwise the combo is void.
In each case, when we start typing in the field, after the specified number of chars, a search on the server is started to show the dropdown with the corresponding records.
We select one of the items, so fixing the whole text in the combo and recording a new value for the backing IDProduct (for example, in an observable object, or directly inside the control), and when we submit the page, we send the value to the server.
Lookup comboboxes have always existed in every good user interface library for handling db data, but, for what I could read, study, and try, it's not easily done with this component.
There are the datasource, the transport, the additionaldata, filter parameters, autobind true or false, the binding of a numeric value that becomes initially also the text shown in the combo, since there are not still values in the inner cache, and so on...
I opened tickets, and solved problems one at a time, but in each case, I fixed a problem just to open another, never closing the gap to obtain a really functioning solution.
Is there anyone who wrote some *real* code that can help me, with this problem?
I find very strange that Telerik didn't make a complete sample for this behaviour, that is *really* one of the basic, and most needed, functionalities for a component like this?
Or am I missing something really important???
Please help me, I'm tired and stuck... :-(
Andrea