Thursday, July 15, 2010

UltraWebGrid Get the current Filter Item from javascript

I had a problem where I needed to find which filter item I have chosen from the filter drop down. It's easy to get this from server side:

((Infragistics.WebUI.UltraWebGrid.FilterCondition)(e.ActiveColumnFilter.FilterConditions.GetItem(0))).CompareValue

But it seemed pretty difficult to find it from cilent side. In the end, I managed to find it. I used the "BeforeRowFilterApplied" client side event :

function UltraWebGrid1_BeforeRowFilterApplied(gridName, oColumn)
{ $get("<%=tbFilterOperand.ClientID%>").value=oColumn.Band.Grid._currentFilterDropped._evaluationValue;
}

It returned the filter item item (operand) that has been selected. I stored it inside the text field "tbFilterOperand" for later use.