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

Setting the default page number in grid

1 Answer 48 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Admin
Top achievements
Rank 1
Admin asked on 26 Nov 2013, 01:52 PM
Hi,

I’ve following method which I’m using to build data source
for Kendo UI grid. I want to set default page number like default page size but
I can’t see an option in DataSourceBuilder.

Any idea?

public static Action<DataSourceBuilder<T>>DataSourcer<T>(string action, string controller, int total, string area, string jsParamFuncName = "",
int? defaultPageSize = null)     
where T : class 
{
if
(!defaultPageSize.HasValue)
defaultPageSize = int.Parse(ApplicationConfigurationDataHelper.GetByKey(ApplicationConfigurationConstants.DefaultPageSize).Value);
  
return
dataSource => dataSource.Ajax().Read(read =>  {                            
read.Action(action,
controller, new { area });                       
if (!string.IsNullOrEmpty(jsParamFuncName))                                                
{
      read.Data(d => jsParamFuncName);                                                
}                              
}) .Total(total)                        
.PageSize(defaultPageSize.Value)                    
.Events(e => e.Change(JsFunctionNameConstants.EmptyGridMessage));
}

1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 28 Nov 2013, 07:56 AM
Hi,

I already answered to this query in duplicated support ticket created by you - #762583. Please keep in mind that it is highly recommended that you keep related questions in one support thread or a forum post, so that we can easily keep track of your support history and provide better answers in a shorter time. 

Regards,
Vladimir Iliev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Admin
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or