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

NeedDataSource based on filtervalue

1 Answer 40 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Cecilie Nordbø
Top achievements
Rank 1
Cecilie Nordbø asked on 15 Sep 2010, 09:48 AM
Hi. I have a datagrid that use the event NeedDataSource. I don't what to fill up the grid with rows before the user have do a filtering because if not the grid will show many thousand records. So how can i get the filtervalue in NeedDataSource event ?

1 Answer, 1 is accepted

Sort by
0
Accepted
Jayesh Goyani
Top achievements
Rank 2
answered on 15 Sep 2010, 10:16 AM
HI Cecilie Nordbø
inside need dataSource()
--------------------------
if (!IsPostBack)
            {
                  grdClassSchList.MasterTableView.FilterExpression = "([EducationPeriodName] LIKE \'%" + " Year 2010-2011" + "%\') ";

                    GridColumn column = grdClassSchList.MasterTableView.GetColumnSafe("EducationPeriodName");
                    column.CurrentFilterFunction = GridKnownFunction.Contains;
                    column.CurrentFilterValue = "Year 2010-2011";
            }
----------------------------
column Name = "EducationPeriodName"
Filter value = "Year 2010-2011"

and Set this Property for Grid : EnableLinqExpressions="false"

http://www.telerik.com/help/aspnet-ajax/grdapplyingdefaultfilteroninitialload.html
Tags
Grid
Asked by
Cecilie Nordbø
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or