Setting the default page number in grid

2 posts, 0 answers
  1. Admin
    Admin avatar
    5 posts
    Member since:
    Mar 2013

    Posted 26 Nov 2013 Link to this post

    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));
    }
  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2192 posts

    Posted 28 Nov 2013 Link to this post

    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!
Back to Top