This is a migrated thread and some comments may be shown as answers.

FindItemByKeyValue from all grid pages

3 Answers 123 Views
Grid
This is a migrated thread and some comments may be shown as answers.
fzanoni
Top achievements
Rank 1
fzanoni asked on 20 Jul 2010, 06:49 PM
Hi,
Is there a way to find an item that is NOT part of the current page of the grid. (Using pager).
I'm using  "FindItemByKeyValue" but it returns NULL when the item I'm looking for is in another page.

Thanx  a lot!

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 21 Jul 2010, 08:03 AM
Hello,

One easy method to achieve the requirement is disabling the paging when calling FindItemByKeyValue and set the AllowPaging to enabled after that.

C#:
RadGrid1.MasterTableView.AllowPaging = false;
RadGrid1.MasterTableView.Rebind();
 
GridDataItem item = RadGrid1.MasterTableView.FindItemByKeyValue("CustomerID", "BOTTM");
Response.Write(item["CompanyName"].Text);
 
RadGrid1.MasterTableView.AllowPaging = true;
RadGrid1.MasterTableView.Rebind();


-Shinu.
0
fzanoni
Top achievements
Rank 1
answered on 21 Jul 2010, 04:39 PM
Thanks Shinu, but this is not working so well.
In this case rebinding takes too much time I think, also I'm selecting the item ( item.Selected = true;) and this not working when I use this approach.
What I'm trying to achieve is search and select an item (wherever it is), and navigate to the page where the item is located. (using AJAX)
To be more specific....I'm using a modified version "goggle-like" Filtering  (http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandcombo/defaultcs.aspx).
Using:
combo.AllowCustomText = true;
combo.MarkFirstMatch = true;
If the user filters without selecting from the combo then the grid filters.
if the user selects an item from the combo then the grid searches and selects that item.
Thats it.

Thanks a lot for your help!
0
Nikolay Rusev
Telerik team
answered on 27 Jul 2010, 08:13 AM
Hello Fe,

You cannot access items that are not part of current page as this items simply does not exist. RadGrid build items only for current page records from its data source.

Regards,
Nikolay
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
fzanoni
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
fzanoni
Top achievements
Rank 1
Nikolay Rusev
Telerik team
Share this question
or