Hi,
We are trying to select the grid's first row, after applying a (client-side) filter. Our code is as follows :
However, the following line of code : alert(Rows.length); still returns the original number of items in the grid (meaning no filter applied)
Apparently the filtering happens after the remaining code? Any ideas on this behaviour?
We are trying to select the grid's first row, after applying a (client-side) filter. Our code is as follows :
However, the following line of code : alert(Rows.length); still returns the original number of items in the grid (meaning no filter applied)
Apparently the filtering happens after the remaining code? Any ideas on this behaviour?
function selectFirstRow() {
var grid = $find("<%=OnderzoekenGrid.ClientID %>")
if (grid != null)
grid.get_masterTableView().selectItem(0);
}
function filterPatType(sender, args) {
var t = sender.get_text();
var masterTable = $find("<%= OnderzoekenGrid.ClientID %>").get_masterTableView();
masterTable.clearFilter();
if (t == "Ambulanten") {
masterTable.filter('typepatient', 'A', Telerik.Web.UI.GridFilterFunction.EqualTo, true);
}
else if (t == "Gehospitaliseerden") {
masterTable.filter('typepatient', 'H', Telerik.Web.UI.GridFilterFunction.EqualTo, true);
}
var Rows = masterTable.get_dataItems();
alert(Rows.length);
selectFirstRow();
}