Skip to content

Commit 76efbd6

Browse files
authored
Merge pull request #2 from Rabina4363sf/patch-1
KB-15655-Update README.md
2 parents 9876a96 + 8396dd1 commit 76efbd6

1 file changed

Lines changed: 18 additions & 11 deletions

File tree

README.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
# How to Use SfDataPager with DataTable as ItemSource for SfDataGrid
1+
# How to Use SfDataPager with DataTable as ItemSource for WinForms DataGrid?
22

3-
By default, SfDataPager doesn’t accept DataTable as a source, and we have documented this as a limitation below.
4-
5-
[Winforms-DataGrid-Paging Limitation](https://help.syncfusion.com/windowsforms/datagrid/paging#limitations)
3+
By default, In [WinForms DataGrid](https://www.syncfusion.com/winforms-ui-controls/datagrid) (SfDataGrid), [SfDataPager](https://help.syncfusion.com/cr/windowsforms/Syncfusion.WinForms.DataPager.SfDataPager.html) doesn’t accept DataTable as a source, and we have documented this as a limitation in below user guide documentation.
4+
5+
**UG Link:** [Winforms DataGrid Paging Limitation](https://help.syncfusion.com/windowsforms/datagrid/paging#limitations)
66

77
However, we can provide a workaround to achieve your requirement by converting the DataTable to an ExpandoObject. Then, you can set the ExpandoObject collection as the DataSource for SfDataPager, as demonstrated below:
88

9-
```C#
9+
10+
```csharp
1011
private DataTable dataTableCollection;
1112
private ObservableCollection<dynamic> dynamicCollection;
1213
public Form1()
@@ -35,7 +36,6 @@ public Form1()
3536
sfDataGrid1.DataSource = sfDataPager1.PagedSource;
3637
}
3738

38-
3939
private ObservableCollection<dynamic> _dynamicOrders;
4040

4141
/// <summary>
@@ -56,14 +56,21 @@ public ObservableCollection<dynamic> DynamicOrders
5656

5757
public DataTable DataTableCollection
5858
{
59-
get { return dataTableCollection; }
60-
set { dataTableCollection = value; }
59+
get
60+
{
61+
return dataTableCollection;
62+
}
63+
set
64+
{
65+
dataTableCollection = value;
66+
}
6167
}
62-
6368
```
6469

70+
6571
**Image Reference:**
6672

67-
![DataPager_Image.png](https://support.syncfusion.com/kb/agent/attachment/article/15655/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjIwNjc3Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.k2ExhaJ4xQdYsMIo1gj_ch1tzw5cTEiyTFGe7CaZBc0)
73+
74+
![DataPager_Image.png](https://support.syncfusion.com/kb/agent/attachment/article/15655/inline?token=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjIwNjc3Iiwib3JnaWQiOiIzIiwiaXNzIjoic3VwcG9ydC5zeW5jZnVzaW9uLmNvbSJ9.k2ExhaJ4xQdYsMIo1gj_ch1tzw5cTEiyTFGe7CaZBc0)
6875

69-
Take a moment to peruse the [Winforms DataGrid - Paging Documentation](https://help.syncfusion.com/windowsforms/datagrid/paging) documentation, to learn more about Paging with examples.
76+
Take a moment to peruse the [Winforms DataGrid - Paging](https://help.syncfusion.com/windowsforms/datagrid/paging) documentation, to learn more about paging with examples.

0 commit comments

Comments
 (0)