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

6 posts, 0 answers
  1. Daniel
    Daniel avatar
    16 posts
    Member since:
    Jun 2013

    Posted 26 Jan 2015 Link to this post

    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.

  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1793 posts

    Posted 28 Jan 2015 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dan
    Dan avatar
    29 posts
    Member since:
    Oct 2013

    Posted 21 Apr 2015 Link to this post

    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?

  5. Dan
    Dan avatar
    29 posts
    Member since:
    Oct 2013

    Posted 21 Apr 2015 in reply to Dan Link to this post

    Actually I mis-wrote. The List gets converted to a dataTable, is that the problem ?
  6. Dan
    Dan avatar
    29 posts
    Member since:
    Oct 2013

    Posted 21 Apr 2015 in reply to Dan Link to this post

    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.
  7. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1793 posts

    Posted 24 Apr 2015 Link to this post

    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.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017