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

auto post back filter on generated columns

1 Answer 64 Views
Grid
This is a migrated thread and some comments may be shown as answers.
alex
Top achievements
Rank 1
alex asked on 04 Sep 2014, 05:12 AM
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

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 04 Sep 2014, 04:29 PM
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
Tags
Grid
Asked by
alex
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or