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

Search Panel not working

3 Answers 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Test
Top achievements
Rank 1
Test asked on 20 Oct 2020, 05:13 PM

Hi, i have this code, everything work good except the search panel. I miss something?

@(Html.Kendo().Grid<GestionLaboratorio.Models.BD_HCE.LAB_GetContenedorOpenLab_Result>()
                                .Name("gridOpenLab")
                                .Columns(columns =>
                                {
                                    columns.Bound(p => p.id).Title("ID").Width(100);
                                    columns.Bound(p => p.nombre).Title("Descripcion");
                                    columns.Bound(p => p.abreviatura).Title("Abreviatura").HtmlAttributes(new { style = "text-align: center;" }).HeaderHtmlAttributes(new { style = "text-align: center;" });
                                    columns.Bound(p => p.tipoImpresion).Title("Tipo de impresion").EditorTemplateName("TipoImpresionOpenLab").ClientTemplate("#:DescTipoImpr#").HeaderHtmlAttributes(new { style = "text-align: center;" });
                                    columns.Command(command => { command.Edit().Text(" ").CancelText(" ").UpdateText(" "); command.Destroy().Text(" "); }).Width(150).HtmlAttributes(new { style = "text-align: center;" });
                                })
                                .Editable(editable => editable.Mode(GridEditMode.InLine))
                                .ToolBar(t => t.Search())
                                .Pageable()
                                .Sortable()
                                .Scrollable()
                                .HtmlAttributes(new { style = "height: 500px;" })
                                .DataSource(dataSource => dataSource
                                    .Ajax()
                                    .PageSize(8)
                                    .Events(events => events.Error("error_handler"))
                                    .Model(model =>
                                    {
                                        model.Id(f => f.id);
                                    })
                                    .Read(read => read.Action("Get_Contenedor_OpenLab", "OpenLab"))
                                    .Update(update => update.Action("Update_Contenedor_OpenLab", "OpenLab"))
                                    .Destroy(destroy => destroy.Action("Delete_Contenedor_OpenLab", "OpenLab"))
                                )
                                .Events(events => events.Save("contenedorGuardado_Save"))
                                .Resizable(resize => resize.Columns(true))

 

public ActionResult Get_Contenedor_OpenLab([DataSourceRequest]DataSourceRequest request)
        {
            try
            {
                return Json(bd_hce_lab.LAB_GetContenedorOpenLab().ToList().ToDataSourceResult(request));
            }
            catch (Exception e)
            {
                return Json(null);
            }
        }

 

 

 

 

3 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 22 Oct 2020, 11:09 AM

Hello,

Thank you for the provided code snippet. I looked into and I did not find anything that might be causing the faulty behavior. 

Is it possible for you to open the DevTools Network tab and examine what request is sent and what is its response status? Also, can you confirm that you are filtering only by string values as the number filtering is not available due to the fact that the widget filters by the operator "contains"? This is mentioned in the following documentation article:

Below I am posting the live demo for Search Panel:

Regards,
Nikolay
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Test
Top achievements
Rank 1
answered on 22 Oct 2020, 02:37 PM

Solved it,

My model contains integer, so that was the reason why the search panel didn't work.

thank you.

0
Nikolay
Telerik team
answered on 26 Oct 2020, 10:33 AM

Hello,

I am glad to hear my suggestion helped you move forward.

Please let us know if anything new arises.

Regards,
Nikolay
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Test
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Test
Top achievements
Rank 1
Share this question
or