auto post back filter on generated columns

2 posts, 0 answers
  1. alex
    alex avatar
    1 posts
    Member since:
    Jan 2014

    Posted 04 Sep 2014 Link to this post

    Hi, I am using

    <MasterTableView AutoGenerateColumns="true" AllowFilteringByColumn="True"

    to auto generate columns in grid and allow filtering, I would like to allow user to press enter to apply filter, and limit each filter by to 50px only for their width.

    I was using this when i used to predefine the columns :

    <telerik:GridBoundColumn FilterControlWidth="50px" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo"

    how to do this with auto generated columns?  Thanks.

    Regards,
    Alex
  2. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 04 Sep 2014 in reply to alex Link to this post

    Hi,

    Please try with the below code snippet.

    protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
    {
        e.Column.FilterControlWidth = Unit.Pixel(50);
        e.Column.AutoPostBackOnFilter = true;
        e.Column.CurrentFilterFunction = GridKnownFunction.Contains;
    }


    Thanks,
    Jayesh Goyani
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top