I have used XamWebGrid in my page and use the default paging as well.
I kept the page size as 5.When I am adding new rows to the grid.means suppose there are 7 rows in your grid.so you will get 2 pages.but when I try to save on the basis of loop through grid
foreach (Row item in JiraItemsGrid.Rows) { testCaseJira = new Web.Cortex.WcfServiceReference.TestCaseJira(); string key = item.Cells[0].Value.ToString(); if (key.LastIndexOf('/') != -1) { int lastindex = key.LastIndexOf('/'); key = key.Substring(lastindex + 1, ((key.Length - key.LastIndexOf('/')) - 1)); } if (key != string.Empty) { // string JiraKey = item.Cells[0].Value.ToString().Split(''); //testCaseJira.ProjectID = (int)currentNode; testCaseJira.projectID = ApplicationId; testCaseJira.jiraKey = key; testCaseJira.status = item.Cells[1].Value == null ? "" : item.Cells[1].Value.ToString(); testCaseJira.summary = item.Cells[2].Value == null ? "" : item.Cells[2].Value.ToString(); testCaseJira.description = item.Cells[3].Value == null ? "" : item.Cells[3].Value.ToString(); testCaseJira.issueType = item.Cells[4].Value == null ? "" : item.Cells[4].Value.ToString(); testCaseJiraProfileList.Add(testCaseJira); } }
I got only 5 rows in the rowcount if I am on the page 1.But if I want to retrieve all the 7 record is there any way apart from picking up those records from collection ?
Please suggest....
-Pankaj
HI,
The grids Rows collection only contains the rows currently in view.
You should always use the collection bound to the grid, if you want to get the unfiltered/unpaged data.
Note, this will be much more performant as well, as accessing data via the Cell’s Value property is slow b/c it uses a Binding to resolve it.
Sincerely, MattDeveloper Support Engineer
Thanks for the nice clarification.