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

[Solved] Default filter on load

2 Answers 150 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael Dunbar
Top achievements
Rank 2
Michael Dunbar asked on 22 Jul 2009, 08:36 AM
Hi,

Bit of help please.

I am trying to follow this tutorial: http://www.telerik.com/help/aspnet-ajax/grdapplyingdefaultfilteroninitialload.html but am struggling to get my head around it. I want to set a filter on a "Date modified" field so that the last document modified (my grid row) is always at the top of the list.

I am using advanced databinding to populate my grid but I do not use a traditional SQL datasource directly. I am populating my grid from an object returned as a list.

Would somebody been kind enough to give me some example code of a filter that orders by date as described?

Thanks,

Michael

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 22 Jul 2009, 10:03 AM
Hello Michael,

It seems you are confused with Sorting and Filtering. If you want to display the last modified date on the top of the grid followed by other dates in order, then you can set the SortExpressions fro the grid as shown below:
aspx:
 <telerik:RadGrid ID="RadGrid1" DataSourceID="Sqldatasource1" 
        runat="server"
     <MasterTableView> 
          <SortExpressions> 
              <telerik:GridSortExpression FieldName="Date Modified" SortOrder="Ascending"/> 
          </SortExpressions> 

Thanks
Princy.
0
Michael Dunbar
Top achievements
Rank 2
answered on 22 Jul 2009, 10:05 AM
You're quite right, I've got myself mixed up!

Thanks for the help Princy. Sorted.
Tags
Grid
Asked by
Michael Dunbar
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Michael Dunbar
Top achievements
Rank 2
Share this question
or