We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Grid with datamanager not working the differents filtering types

Thread ID:

Created:

Updated:

Platform:

Replies:

123332 Mar 8,2016 11:46 AM Mar 15,2016 02:13 AM ASP.NET Web Forms 8
loading
Tags: Grid
Roimer Machacón Otero
Asked On March 8, 2016 11:46 AM

Hi, we're using grid with datamanager for load the data and in the grid we've activated the filtersettings (we've tested filtertype excel and filterbar) now, with the datamanager neither type of filter is working, not filter nothing.

Attached image with this case.

Attachment: error_filter_in_grid_5ede4806.rar

Jayaprakash Kamaraj [Syncfusion]
Replied On March 9, 2016 01:59 AM

Hi Roimer,
Thanks for contacting Syncfusion support.

We have tested the DataManager property with Filtering in Grid, but we were unable to reproduce the issue. Please share the following information to find the cause of the issue and provide a solution,                                                                          

1.       Are you using any Adaptors in Datamanager?

2.       Grid rendering code example.

3.       Syncfusion Essential studio, browser and operating system version.

4.       An issue reproducing sample if possible or sample hosted link or replicate the issue in the following    sample.

Sample: http://www.syncfusion.com/downloads/support/forum/123332/ze/SyncfusionASPNETApplication171109872337

5.       Is there any script error thrown in console? If so, please attach a screenshot of the error.

Regards,

Jayaprakash K.


Roimer Machacón Otero
Replied On March 9, 2016 02:54 PM

Hi here more information about of this error


Are you using any Adaptors in Datamanager?

R/ Yes, we´re using adaptor in the datamanager, Here is the definition of the grid.


Syncfusion Essential studio Version: 12.4.0.34

Browser: All browsers

Operating system version: Windows 7


Is there any script error thrown in console? If so, please attach a screenshot of the error.

R/ Yes its generate error in console, attached image with the error


Attachment: error_console_4306adad.rar

Jayaprakash Kamaraj [Syncfusion]
Replied On March 10, 2016 04:49 AM

Hi Roimer,

We have tested the DataManager property with WebMethodAdaptor in Grid, but we were unable to reproduce the issue. Please share the following information to find the cause of the issue and provide a solution,                                                                          

1. Type of the Adaptor.

2. Grid rendering code example.

3. An issue reproducing sample if possible or sample hosted link or replicate the issue in the following sample.

Sample:  http://www.syncfusion.com/downloads/support/forum/123332/ze/SyncfusionASPNETApplication17310823519


Regards,

Jayaprakash K.


Roimer Machacón Otero
Replied On March 10, 2016 12:09 PM

Hi, viewing the example cannot understand, how obtain the information?

We're using this code for try the data:

Javascript
 var adaptor = new ej.UrlAdaptor().extend({
            processResponse: function (data, ds, query, xhr, request, changes) {
                if (data.d)
                    data = data.d
                return ej.UrlAdaptor.prototype.processResponse.apply(this, [data, ds, query, xhr, request, changes])
            }
        });
        function loadHandler(args) {
            args.model.dataSource.adaptor = new adaptor();
        }

      function actionBegin(args) {
            this.model.query.addParams("codigo", $("#hdfCodigo").val())
        }

Aspx
<ej:Grid ID="gvsDesviacionEjecutado" runat="server" AllowGrouping="false" AllowSelection="true" TabIndex="-1" Locale="es-ES"
  Selectiontype="Single" AllowSorting="false" AllowPaging="true" AllowFiltering="true"
  AllowScrolling="false" AllowResizing="false" ClientIDMode="Static" ShowStackedHeader="false">
  <ClientSideEvents Load="loadHandler" ActionBegin="actionBegin" RowSelected="filaDesviacionEjecutado" QueryCellInfo="personalizarCeldas" />

  <DataManager URL="PresupuestoPlanPeriodo.aspx/CargarDesviacionEjecutadoPlanPeriodo" Adaptor="UrlAdaptor" />
  <GroupSettings EnableDropAreaAutoSizing="False"></GroupSettings>
  <PageSettings PageCount="10" />
  <%--<FilterSettings FilterBarMode="Immediate" ShowFilterBarStatus="True" StatusBarWidth="300"></FilterSettings>--%>
  <FilterSettings FilterType="Excel" />
  <Columns>
  <ej:Column Field="idDesviacionEjecutado" HeaderText="<%$ Resources:Generales, id %>" IsPrimaryKey="true" Width="2%" Visible="false" />
  <ej:Column Field="idMotivo" HeaderText="idDesviacionMotivo" Width="1%" Visible="false" />
  <ej:Column Field="motivo" HeaderText="motivo" Width="1%" Visible="false" />
  <ej:Column Field="idCategoria" HeaderText="idDesviacionCategoria" Width="1%" Visible="false" />
  <ej:Column Field="actividad" HeaderText="<%$ Resources:Generales, actividad %>" Width="38%" />
  <ej:Column Field="unidad" HeaderText="<%$ Resources:Generales, unidad %>" Width="15%" />
  <ej:Column Field="tipoPago" HeaderText="<%$ Resources:Generales, tipo %>" Width="13%" />
  <ej:Column Field="idLote" HeaderText="<%$ Resources:Generales, lote %>" Width="13%" />
  </Columns>
</ej:Grid>

Code behind

 <WebMethod()> _
     <ScriptMethod(ResponseFormat:=ResponseFormat.Json)> _
    Public Shared Function CargarDesviacionEjecutadoPlanPeriodo(skip As Integer, take As Integer, codigo As String) As Object
        Dim ImplementacionPlanPeriodoPresupuesto As New ImplementacionPlanPeriodoPresupuesto
        Try
            Dim listaDetalles = ImplementacionPlanPeriodoPresupuesto.listarDetallesGrillaEjecutado(codigo)
            Dim entidad As New PresupuestoPlanDesvioEjecutadoEntidadResult()
            entidad.result = listaDetalles.Skip(skip).Take(take).ToList()
            entidad.count = listaDetalles.Count()
            Return entidad

        Catch ex As Exception
            Throw ex
        End Try
    End Function

Roimer Machacón Otero
Replied On March 10, 2016 06:10 PM

Hi, attached example with the error

The page is Default.aspx where is the grid

Attachment: PruebaSyncfusion_4d9f9ba5.zip

Jayaprakash Kamaraj [Syncfusion]
Replied On March 11, 2016 06:44 AM

Hi Roimer,

We found that you are using UrlAdaptor. In ASP, we are unable to get particular filtered column dataSource using UrlAdaptor and that causes the issue “Filterpop shows as empty” in filtering.

We suggest to use webMethodAdaptor to overcome this problem. In this adaptor, we pass the parameter as datamanger. We can get filtered columns dataSource using datamanger and perform (filtering / sorting...etc.) operations using Execute method.
Please refer to the following code example and Knowledge Base document,


<ej:Grid ID="Grid1"    AllowPaging="True"

            EnableRowHover="true" AllowFiltering="True"            

               runat="server">

               <DataManager URL="GridFeatures.aspx/Data" Adaptor="WebMethodAdaptor" />

            <Columns>

                <ej:Column Field="OrderID" HeaderText="Order ID"    TextAlign="Right" Width="90" />

                <ej:Column Field="CustomerID" HeaderText="Customer ID"   Width="100"  />

                <ej:Column Field="EmployeeID" HeaderText="Employee ID"  TextAlign="Right" Width="110"  />

                <ej:Column Field="Freight" HeaderText="Freight"  TextAlign="Right" Width="90"  />              

                <ej:Column Field="ShipCity" HeaderText="Ship City" Width="100" />

            </Columns>

           <FilterSettings FilterType="Excel"></FilterSettings>
        </ej:Grid>
GridFeatures.aspx.vb

    < WebMethod > _

< ScriptMethod (ResponseFormat:= ResponseFormat.Json)> _

    Public Shared Function Data(value As Syncfusion.JavaScript.DataManager) As Object

        Dim DataSource = New NorthwindDataContext().OrdersViews.ToList()

        Dim operation As New Syncfusion.JavaScript.DataSources.DataOperations()

        Data = operation.Execute(DataSource, value)

        Dim count As Integer = Data.AsQueryable().Count()

        Return New With { _

            Key .result = Data, _

            Key .count = count _

        }
    End Function


 https://www.syncfusion.com/kb/4300/server-side-api-for-datamanager-operations

Regards,

Jayaprakash K.

Roimer Machacón Otero
Replied On March 14, 2016 11:47 AM

Now, the answer work correctly, but we're need that the information to load in the grid is dependent of a value in a textbox, with UrlAdaptor we can use actionBegin for pass the value required, now with  WebMethodAdaptor  exist a form for make this?

function actionBegin(args) {
            this.model.query.addParams("codigoPlan", $("#txtNumeroPlan").val())
}


Jayaprakash Kamaraj [Syncfusion]
Replied On March 15, 2016 02:13 AM

Hi Roimer,
We had an issue with webMethodAdaptor while passing an extra parameter to server side using addParams in version 12.4.0.34 . The mentioned issue was resolved in version 13.3.0.7. So, we suggest you to download and upgrade to the latest Essential Studio version from the following link,
http://www.syncfusion.com/forums/123314/essential-studio-2015-volume-4-service-pack-release-v13-4-0-63-available-for-download
Regards,
Jayaprakash K.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;