Ho can I highlight the row when the checkbox is selected?
I added the following, but it doen't work after a filter or sort because the rowIdx is correct only when all rows are displayed.
Any idea
CODE BEHIND:
----------------------
int rowIdx = 0;
protected void grdLegalEntities_ItemCreated(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem item = (GridDataItem)e.Item;
CheckBox chk = (CheckBox)item["clmyesno"].Controls[0];
chk.Enabled = true;
chk.Attributes.Add("onclick", "SelectCurrentRow(" + rowIdx + ");");
rowIdx++;
}
}
JAVASCRIPT:
---------------------
function SelectCurrentRow(rowIdx)
{
var grid = $find('<%=grdLegalEntities.ClientID %>');
grid.get_masterTableView().get_dataItems()[rowIdx].set_selected("true");
}