While working with GridView, I encountered an issue when binding the data to the GridView. The error message read as “The data source does not support server-side data paging“. Initially I thought this was related to paging functionality of the GridView and looked into that, but that was not the solution. After doing a bit of searching, I discoverd that the reason for this error was the way a source is bound to the GridView. I will explain.
Initially this was my LoadData():
- private void LoadData()
- {
- ProductInventory[] lines = GetData();
- grdRows.DataSource = lines.Where(t => t.ProductID.StartsWith(tbSearch.Text));
- grdRows.DataBind();
- }
- private void LoadData()
- {
- ProductInventory[] lines = GetData();
- grdRows.DataSource = lines.Where(t => t.ProductID.StartsWith(tbSearch.Text)).ToList();
- grdRows.DataBind();
- }
I hope you like this! Keep learning and sharing! Cheers!

Comments
Join the conversation! Your thoughts help the community grow.