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

review request for 'Applying Default Filter on Initial Load' doc

5 Answers 57 Views
Documentation and Tutorials
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 26 Jan 2015, 09:37 AM
Hi,

on http://www.telerik.com/help/aspnet-ajax/grid-applying-default-filter-on-initial-load.html , at bottom of page, where it say:

<MasterTableView FilterExpression="([chkBoxColumnDataField] = True)">

I thing the right text should be:

<MasterTableView FilterExpression="([BoolField] = True)">

Also, for me, right syntax may be:

<MasterTableView FilterExpression="( it.BoolField = True)">

Regards.
Daniel.

5 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 28 Jan 2015, 03:18 PM
Hello Daniel,

Thank you for bringing this to our attention.

I completely agree with you that it would be better if we replace the "chkBoxColumnDataField" text with the actual data field from the actual example. I could only assume that the idea behind having the "chkBoxColumnDataField" is to indicate that this string should be replaced with the DataField that we need to filter on, but in the context of the example, it should be "BoolField". 

I will log this in our system, so the example could be changed accordingly.



Best Regards,
Konstantin Dikov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Dan
Top achievements
Rank 1
answered on 21 Apr 2015, 03:48 PM

I am also having trouble implementing FilterExpression for the  GridCheckBoxColumn

I am using  Telerik.web.UI 3.5  2014 Q3

My Code looks like this: 
.....FilterExpression="([empActive] = True)" ....(and several other variations)

<telerik:GridCheckBoxColumn DataField="empActive" ....

I get:
[ParseException: No property or field 'empActive' exists in type 'DataRowView']
my data source is: a list List<Employee> : is that the problem?

0
Dan
Top achievements
Rank 1
answered on 21 Apr 2015, 03:54 PM
Actually I mis-wrote. The List gets converted to a dataTable, is that the problem ?
0
Dan
Top achievements
Rank 1
answered on 21 Apr 2015, 04:24 PM
Issue is partially solved I used the List for the data source.
The Grid is filtered by default, even though the check box isn't checked.
0
Konstantin Dikov
Telerik team
answered on 24 Apr 2015, 07:04 AM
Hello Dan,

Can you please confirm that you are following all the suggestions from the below help article:
As you can notice, you need to set the FilterExpression, as well as the CurrentFilterFunction and the CurrentFilterValue properties of the column you need to filter on:
protected void RadGrid1_PreRender(object sender, System.EventArgs e)
{
    if (!Page.IsPostBack)
    {
        RadGrid1.MasterTableView.FilterExpression = "([Country] LIKE \'%Germany%\') ";
        GridColumn column = RadGrid1.MasterTableView.GetColumnSafe("Country");
        column.CurrentFilterFunction = GridKnownFunction.Contains;
        column.CurrentFilterValue = "Germany";
        RadGrid1.MasterTableView.Rebind();
    }
}

If the issue persists, please provide the code-behind and the markup of the column you want to filter.


Regards,
Konstantin Dikov
Telerik
 

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

 
Tags
Documentation and Tutorials
Asked by
Daniel
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Dan
Top achievements
Rank 1
Share this question
or