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

Filter on combobox lookup column not working

7 Answers 178 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ariel
Top achievements
Rank 1
Ariel asked on 31 Mar 2015, 06:15 PM
Hi everyone,

I have a Telerik mvc grid with filter mode set to “GridFilterMode.Row”.
One of the columns is a lookupComboBox modified from this example: http://www.telerik.com/support/code-library/grid-editing-using-combobox-with-remote-binding-and-filtering


Now, the filtering capability for the lookupcombobox does not work at all, please see attached image for details. Same issue can be seen in the example provided by Telerik (see link above).

Has anyone seen this issue? Any ideas on how to get the filter to work properly with the lookupcombobox?

Thanks  

7 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 02 Apr 2015, 04:46 PM
Hello Ariel,

Would it be possible to share more information about the current implementation, that will help us to observe the depicted erroneous behavior locally? This will help us to review the problem locally and narrow the problem down much faster. A runnable test demo will be of a great help too.

Regards,
Georgi Krustev
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Ariel
Top achievements
Rank 1
answered on 02 Apr 2015, 06:33 PM
Hi Georgi sure that will be great I can run a test demo if you want. My office phone number is (954)628-0755, give a quick call and we can coordinate details

-Ariel 
0
Georgi Krustev
Telerik team
answered on 03 Apr 2015, 11:31 AM
Hello Ariel,

I answered to the support ticket opened on the same subject. I would like to ask you to continue our discussion in only one thread to avoid duplication. Thank you for the understanding.

Here is quote of the answer:

I further investigate the case and I can clarify that the described behavior is expected. The field related to the column in question is an object. In this case, the filter row or the filter menu will not be able to generate a filter widget, as they cannot know how to treat an object filtration. This is applicable to the server filtering too. The send filter expression tries to filter an object by string value, which is unsupported scenario.

With regards to the server filtering, one possible option is to modify the send filter expression in a such way that it will filter a particular field of that object and not the whole object. 

With regards to the filter menu and row, you will need to create a custom filter menu in order to handle the object filtration scenario. Please check this online demo for more details. For filter row, you can define custom template too:
.Columns(columns =>
    columns.Bound(o => o.OrderDate)
    .Filterable(filterable =>
        filterable.Cell(cell =>
            cell.Template("customTemplate")
            )
        )
    )
)
Here is a Dojo demo that demonstrates the expected outcome.

Regards,
Georgi Krustev
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Ariel
Top achievements
Rank 1
answered on 16 Apr 2015, 08:03 PM

Georgi,

Thanks for the reply.Using your example, I was able to implement the “kendoComboBox”; however, I need to pass a “text” as a method parameter to the controller to make the combobox work.  So, how can I pass the text input to the controller? 

columns.Bound(q => q.Vendor).ClientTemplate("#: data.Vendor ? data.Vendor.Name : '[None]' #") .EditorTemplateName("ComboBoxLookup_Vendor")
.Filterable(filterable => filterable.Cell(cell => cell.Template("vendorFilter"))).Width(200);

function vendorFilter(container) {
            container.element.kendoComboBox({
                name: "vendors",
                dataTextField: "Name",
                dataValueField: "VendorID",
                placeholder: "Select a vendor",
                autoBind: false,
                dataSource: {
                    transport: {
                        read: "@Url.Action("_GetVendors", "Quote")",
                    },
                    serverFiltering: false
                },
            });
        }

Controller:

public ActionResult _GetVendors(string text)

 

Thanks

0
Georgi Krustev
Telerik team
answered on 20 Apr 2015, 09:07 AM
Hello Ariel,

I would suggest you check the ComboBox overview help topic, which explains how to send additional values to the server. You can also refer to this code library, which uses this approach in action.

Regards,
Georgi Krustev
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Ariel
Top achievements
Rank 1
answered on 20 Apr 2015, 06:58 PM

Georgi,

 The your examples use s

.DataSource(source => { source.Read(read => read.Action("GetProducts", "Home").Data("onAdditionalData"); }); })

 I am using:

dataSource: { transport: { read: "@Url.Action("_GetVendors", "Quote")" }, },

 

Do you have an example I can look at using this approach? thanks

 

 

0
Georgi Krustev
Telerik team
answered on 22 Apr 2015, 10:21 AM
Hello Ariel,

Based on the given information, I suppose that you are skipping the ASP.NET MVC wrapper and initialize the widget instead using JavaScript. If this is the case, then note that the server wrapper actually produces JavaScript initialization script similar to one that you have written.

We do not have demo similar to the shared code library only using JavaScript, but it produces JavaScript initialization scripts that you can use to accomplish your goal.

If the problem still persists, please send us a simple repro demo that depicts the issue. This will help us to review the problem locally and advice you further much faster.

Regards,
Georgi Krustev
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
Grid
Asked by
Ariel
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Ariel
Top achievements
Rank 1
Share this question
or