A page requires that the value of RowIndex continue to increase when I go to the next page, yet it resets to 0 in the first column of each page.
I want the index to be 0, 1 , 2 , 3 on the first page, then 4, 5, 6, 7 on the next page; however, on the next page it would go to 0, 1, 2, 3 instead of continually increasing. Does anyone have any idea why this would be happening?
Here are the attributes of the grid:
<telerik:RadGrid ID="_EmpGrid" Skin="Web20" GridLines="None" runat="server" PageSize="10"
AllowPaging="True" OnItemCreated="_EmpGrid_ItemCreated">
This is the Javascript behind the grid
function ShowEditPanel(id, title_id, rowIndex)
{
var grid = $find("<%= _EmpGrid.ClientID %>");
var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
grid.get_masterTableView().selectItem(rowControl, true);
window.radopen("EmpPanel.aspx?EmpId=" + id + "&TitleId=" + title_id + "&Key=" + rowIndex, "EmpDialog");
return false;
}
and this is the function the grid calls upon
I want the index to be 0, 1 , 2 , 3 on the first page, then 4, 5, 6, 7 on the next page; however, on the next page it would go to 0, 1, 2, 3 instead of continually increasing. Does anyone have any idea why this would be happening?
Here are the attributes of the grid:
<telerik:RadGrid ID="_EmpGrid" Skin="Web20" GridLines="None" runat="server" PageSize="10"
AllowPaging="True" OnItemCreated="_EmpGrid_ItemCreated">
This is the Javascript behind the grid
function ShowEditPanel(id, title_id, rowIndex)
{
var grid = $find("<%= _EmpGrid.ClientID %>");
var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
grid.get_masterTableView().selectItem(rowControl, true);
window.radopen("EmpPanel.aspx?EmpId=" + id + "&TitleId=" + title_id + "&Key=" + rowIndex, "EmpDialog");
return false;
}
and this is the function the grid calls upon
protected void _EmpGrid_ItemCreated(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
HyperLink editLink = (HyperLink)e.Item.FindControl("_EditLink");
editLink.Attributes["href"] = "#";
editLink.Attributes["onclick"] = String.Format("return ShowEditPanel('{0}', '{1}', '{2}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Employee_ID"], e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Employee_title_Id"], e.Item.ItemIndex);
}
}