Hi,
I have a RadGrid with Paging, Sorting and Filtering enabled. The datasource is provided in the code-behind using the NeedDataSource event.
Now I want to select a row with a certain DataKeyValue. This is currently done with the folowing method I created:
The above code works only when the certain DataKeyValue is present on the current Grid Page. Only the DataKeyValues of the current page are present in the DataKeyValues collection.
For as far I know I cannot request the binded datasource (whith filtering and sorting implemented) from the Grid, so I cannot calculate on which Grid Page the DataKeyValue should exist.
Does anybody know how I can select a row on another Page of the Grid? Is there a way to request the binded datasource from the Grid, so I can calculate the PageIndex of the row which must be selected?
Thanx,
Danny
I have a RadGrid with Paging, Sorting and Filtering enabled. The datasource is provided in the code-behind using the NeedDataSource event.
Now I want to select a row with a certain DataKeyValue. This is currently done with the folowing method I created:
public void SelectRow<DataKeyType>(DataKeyType dataKeyValue) |
{ |
int index = 0; |
foreach (Telerik.Web.UI.DataKey key in this.MasterTableView.DataKeyValues) |
{ |
DataKeyType value = key.Values.OfType<DataKeyType>().FirstOrDefault(); |
this.MasterTableView.Items[index].Selected = (value.Equals(dataKeyValue)); |
index++; |
} |
} |
For as far I know I cannot request the binded datasource (whith filtering and sorting implemented) from the Grid, so I cannot calculate on which Grid Page the DataKeyValue should exist.
Does anybody know how I can select a row on another Page of the Grid? Is there a way to request the binded datasource from the Grid, so I can calculate the PageIndex of the row which must be selected?
Thanx,
Danny