Search for paginated records in RadGrid Telerik

How can I find this entry by key in radGrid when pagination is enabled? After inserting an element, I would like to select a new row, so I need this functionality.

thanks for any help

+2
source share
3 answers

One way is to disable paging, then do Rebind , then Rebind over all the elements, find the page where the element should be located, and then enable paging. Another way is to make a separate Rebind on the page, for example:

 int count = RadGrid1.MasterTableView.PageCount; for (int i = 0; i < count; i++) { RadGrid1.CurrentPageIndex = i; RadGrid1.Rebind(); foreach (GridDataItem dataItem in RadGrid1.Items) { var yourID = dataItem.GetDataKeyValue("YourID"); if (yourID == insertedItemID) break; } } RadGrid1.Rebind(); 

For more information and an example, check out the Telerik forums. These links are useful:

0
source

Here is a link from Telerik that will select the line Last updated or Last Inserted.

Select the last updated or inserted row in Telerik RadGrid

0
source
 RadGrid1.AllowPaging = false; RadGrid1.Rebind(); foreach (GridDataItem dataItem in RadGrid1.Items) { var yourID = dataItem.GetDataKeyValue("YourID"); if (yourID == insertedItemID) break; } 

RadGrid1.AllowPaging = true; RadGrid1.Rebind ();

0
source

Source: https://habr.com/ru/post/1386655/


All Articles