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

Radgrid client side filter case sensitive

1 Answer 166 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nice2
Top achievements
Rank 1
Nice2 asked on 06 Sep 2012, 03:10 PM
Hello, 

I have a grid that loads the data through a web-service. This is my code:

Grid:
<telerik:RadGrid runat="server" ID="rgOverzicht" Width="690px" PageSize="10"
                AllowPaging="true" AllowSorting="false" ClientSettings-Scrolling-AllowScroll="false" ClientSettings-Scrolling-UseStaticHeaders="true" AllowFilteringByColumn="false" AllowMultiRowSelection="false" EnableLinqExpressions="false">
                <GroupingSettings CaseSensitive="false" />
                <MasterTableView NoMasterRecordsText="Geen artikelen om te tonen." DataKeyNames="Artikel_Id" ClientDataKeyNames="Artikel_Id" TableLayout="Fixed">
                    <PagerStyle Mode="NextPrevAndNumeric" PagerTextFormat="<b>{4}</b>  Pagina <b>{0}</b> van <b>{1}</b> | Item <b>{2}</b> t/m <b>{3}</b> van de <b>{5}</b>. " ShowPagerText="True" />
                    <Columns>
                        <telerik:GridBoundColumn DataField="IndexNr" UniqueName="IndexNr" HeaderText="Index" HeaderStyle-Width="65px"  />
                        <telerik:GridBoundColumn DataField="Omschrijving" UniqueName="Omschrijving" HeaderText="Omschrijving" />
                        <telerik:GridBoundColumn DataField="Afmeting" UniqueName="Afmeting" HeaderText="Afmeting" HeaderStyle-Width="65px"  />
                        <telerik:GridBoundColumn DataField="Drukklasse" UniqueName="Drukklasse" HeaderText="Drukklasse" HeaderStyle-Width="65px"  />
                        <telerik:GridBoundColumn DataField="Eenheidstarief" UniqueName="Eenheidstarief" HeaderText="Prijs (in €)" HeaderStyle-Width="75px"  />
                    </Columns>
                    <PagerStyle Mode="NumericPages" />
                </MasterTableView>
                <ClientSettings EnableRowHoverStyle="true">
                    <DataBinding SelectMethod="GetDataAndCount"
                    Location="~/CalculatieGrid.asmx"
                        SortParameterType="Linq" FilterParameterType="Linq" >
                    </DataBinding>
                    <Selecting AllowRowSelect="True" />
                </ClientSettings>
            </telerik:RadGrid>

Web-service:
var data = RadGrid.GetBindingData(source, startRowIndex, maximumRows, sortExpression, filterExpression);
 
result.Data = data.Data.ToList();
result.Count = data.Count;
 
return result;

JavaScript filter function:
<script type="text/javascript">
                $("#Search").click(function (e) {
                    if ($('#txtFilterOmschrijving').val() != "" && $('#txtFilterOmschrijving').val() != $('#txtFilterOmschrijving').attr("defaultValue")) {
                        filterExpression = new Telerik.Web.UI.GridFilterExpression();
                        filterExpression.set_fieldName("Omschrijving");
                        filterExpression.set_columnUniqueName("Omschrijving");
                        filterExpression.set_dataTypeName("System.String");
                        filterExpression.set_filterFunction(Telerik.Web.UI.GridFilterFunction.Contains);
                        ItemIdentifier = $('#txtFilterOmschrijving').val();
                        filterExpression.set_fieldValue(ItemIdentifier);
 
                        vFilterExpressions.add(filterExpression);
                    }
                    tableView.rebind();
                    tableViewPlan.rebind();
                });
            </script>

The problem is that the filters are case sensitive. I tried setting the case sensitive option in groupsettings in the grid, but that has no effect. Does anyone have a solution?

Thanks in advance!

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 11 Sep 2012, 03:00 PM
Hi,

Currently there is no control over the case sensitivity of client-side filtering in RadGrid. Whatever you set as value of the filter expression is passed to the web service. You can try modifying the web service to perform case insensitive filtering if this is an option in your case.

Greetings,
Tsvetina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Nice2
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or