Earn Cash from forex trading and free 5$ for Regiatation.

Wednesday, December 3, 2008

FilterRow functionality in the UltraWebGrid when handling its server-side Click event

First set the UltraWebGrid’s AllowRowFiltering property to OnClient and its FilterUIType property to FilterRow.

UltraWebGrid1.DisplayLayout.Bands[0].FilterOptions.AllowRowFiltering = Infragistics.WebUI.UltraWebGrid.RowFiltering.OnClient;
UltraWebGrid1.DisplayLayout.Bands[0].FilterOptions.FilterUIType = Infragistics.WebUI.UltraWebGrid.FilterUIType.FilterRow;


A DataKey must be set so that the UltraWebGrid can distinguish between the FilterRow and a regular GridRow

UltraWebGrid1.DataKeyField = "CustomerID";

Add a client-side handler for the UltraWebGrid’s CellClick event and check for a DataKey to allow postback:

In Javascript:

function UltraWebGrid1_CellClickHandler(gridName, cellId, button){
var rowObj = igtbl_getRowById(cellId);
if( rowObj != null )
{
if( rowObj.getDataKey() == null )
{
igtbl_cancelPostBack(rowObj.gridId)
}
}
}

0 comments: