示例#1
0
        /// <summary>
        /// 更换每页条数
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CB_PageSize_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            _currentIndex = 1;
            GridPagingEventArgs args = new GridPagingEventArgs(20, _currentIndex);

            args.RoutedEvent = GridPagingEvent;
            RaiseEvent(args);
        }
示例#2
0
        /// <summary>
        /// 换页
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void UnSelectNumber_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            Border b = sender as Border;
            GridPagingEventArgs args = new GridPagingEventArgs(20, Convert.ToInt32((b.Child as Label).Content));

            args.RoutedEvent = GridPagingEvent;
            RaiseEvent(args);
        }
示例#3
0
        /// <summary>
        /// 后一页
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Border_Next_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (_currentIndex == _currentPageCount)
            {
                return;
            }
            GridPagingEventArgs args = new GridPagingEventArgs(20, _currentIndex + 1);

            args.RoutedEvent = GridPagingEvent;
            RaiseEvent(args);
        }
示例#4
0
        /// <summary>
        /// 前一页
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Border_Previous_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (_currentIndex == 1)
            {
                return;
            }
            GridPagingEventArgs args = new GridPagingEventArgs(20, _currentIndex - 1);

            args.RoutedEvent = GridPagingEvent;
            RaiseEvent(args);
        }
示例#5
0
        private void NavigateTo(object sender, RoutedEventArgs e)
        {
            int index;

            if (int.TryParse(TB_CurrentIndex.Text, out index))
            {
                if (index != _currentIndex)
                {
                    if (index <= _currentPageCount)
                    {
                        _currentIndex = index;
                    }
                    else
                    {
                        _currentIndex = _currentPageCount;
                    }
                    GridPagingEventArgs args = new GridPagingEventArgs(20, _currentIndex);
                    args.RoutedEvent = GridPagingEvent;
                    RaiseEvent(args);
                }
            }
        }
示例#6
0
        private void DataGridPaging_GridPaging(object sender, GridPagingEventArgs e)
        {
            var key = System.Web.HttpUtility.UrlEncode(TB_search.Text);

            Load(key, e.PageIndex - 1);
        }