GridView Filtering: Localization / Filtering TemplateField

Posted by: someware on 10 September 2017, 11:49 am EST

  • Posted 10 September 2017, 11:49 am EST

    Hi,
    I have two questions regarding filterung the gridview:
    1) How can I localize the filter type ("NoFilter", "BeginsWith", "Contains", etc.)
    2) How can I filter columns realized with templatefields?

    Thanks+Regards, Tobias.
  • Replied 10 September 2017, 11:49 am EST

    Hello Tobias,

    I would like to inform you that currently filtering is not supported for TemplateFields, an enhancement request for the same has already been sent to the concerned team.

    Regarding the issue to localize the Filter dropdown, it can be done at Client-Side using the "_localizeFilterOperators" method of C1GridView which returns an array of FilterOperators. Please refer to the following code for the same:

     
    $(document).ready(function () {
    $("#C1GridView1").data("c1gridview")._localizeFilterOperators([{ name: "nofilter", displayName: "Filtre Yok" }, { name: "beginswith", displayName: "ile Ba?l?yor"}]);

    });


    You can specify the localized strings in the displayName property of each FilterOperator like above.

    Hope this will help you..!!
    Regards
    Nidhi
  • Replied 10 September 2017, 11:49 am EST

    For those who need to localize the FilterOperatorName of asp.net 2.0 C1GridView I offer this code:


    <script type="text/javascript">
    function OperadoresFiltro() {
    $("span.C1TextNode.c1gvfo_NJMA:contains('NoFilter')").text('No Filtrar');
    $("span.C1TextNode.c1gvfo_QB:contains('Contains')").text('Contenga');
    $("span.C1TextNode.c1gvfo_RB:contains('NotContain')").text('No Contenga');
    $("span.C1TextNode.c1gvfo_SB:contains('BeginsWith')").text('Comience con');
    $("span.C1TextNode.c1gvfo_TB:contains('EndsWith')").text('Termine con');
    $("span.C1TextNode.c1gvfo_UB:contains('Equals')").text('Igual');
    $("span.C1TextNode.c1gvfo_VB:contains('NotEqual')").text('No Igual');
    $("span.C1TextNode.c1gvfo_RBMA:contains('IsEmpty')").text('Vacío');
    $("span.C1TextNode.c1gvfo_RJMA:contains('NotIsEmpty')").text('No Vacío');
    $("span.C1TextNode.c1gvfo_WB:contains('Greater')").text('Mayor');
    $("span.C1TextNode.c1gvfo_YB:contains('GreaterOrEqual')").text('Mayor o Igual');
    $("span.C1TextNode.c1gvfo_XB:contains('Less')").text('Menor');
    $("span.C1TextNode.c1gvfo_ZB:contains('LessOrEqual')").text('Menor o Igual');
    $("span.C1TextNode.c1gvfo_RRMA:contains('IsNull')").text('Es nulo');
    $("span.C1TextNode.c1gvfo_RZMA:contains('NotIsNull')").text('No es nulo');
    $("a.C1Link.C1ClearButtonImage").attr('title', 'No Filtrar');
    };
    </script>

    add this property to the grid ClientOnSelectionChanged = "OperadoresFiltro"
  • Replied 10 September 2017, 11:49 am EST

    i can't find how to use such code:

    $(document).ready(function () {
    $("#C1GridView1″).data("c1gridview")._localizeFilterOperators([{ name: "nofilter", displayName: "Filtre Yok" }, { name: "beginswith", displayName: "ile Ba?l?yor"}]);

    });



    2014/05/C1GridViewDemo.zip
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels