/// <summary> /// Wires the paging helper with GridGroupingControl. /// </summary> /// <param name="groupingGrid">GridGroupingControl</param> /// <param name="table">DataTable</param> public async void Wire(GridGroupingControl groupingGrid, HqlDataReader dr) { _grid = groupingGrid; Reader = dr; ResultSet = await dr.FetchResultAsync(); InitializePager(); }
/// <summary> /// A method that was invoked on clicking arrow buttons in pager control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">An <see cref="T:Syncfusion.Windows.Forms.ArrowButtonEventArgs">ArrowButtonEventArgs</see> that contains the event data.</param> async void RecordNavigationBar_ArrowButtonClicked(object sender, ArrowButtonEventArgs e) { switch (e.Arrow) { case ArrowType.Previous: _currentPage -= 1; if (resultCollection.ContainsKey(_currentPage)) { ResultSet = resultCollection[_currentPage]; } FillPage(ResultSet); break; case ArrowType.Next: { _currentPage += 1; if (!Reader.HasRows && !resultCollection.ContainsKey(_currentPage)) { _currentPage -= 1; } else if (!Reader.HasRows && resultCollection.ContainsKey(_currentPage)) { ResultSet = resultCollection[_currentPage]; } else { if (Reader.HasRows) { ResultSet = await Reader.FetchResultAsync(); } } FillPage(ResultSet); DisplayPageInfo(); } break; } }