Hi,
We have been using an older version of Telerik components (Telerik.Web.UI 2010.3.1317.20) in our web application and now we're looking into the latest one trial to upgrade.
One problem we're facing now is that in the same implementation of a RadGrid, getting the index of the selected row was zero based in our existing code (older version of Telerik). However, implementing the same using the new version of Telerik (2014.1.513.40) will return an incremented result.
For example, if the first row of the grid is selected, in the old version the index value was zero, but in the new version it returns 1.
This is the implementation of my RadGrid:
This is how I am getting the index from js:
I would like to know if the behavior of the RadGrid has been changed since the older version, or I am doing something wrong here.
Thank you.
We have been using an older version of Telerik components (Telerik.Web.UI 2010.3.1317.20) in our web application and now we're looking into the latest one trial to upgrade.
One problem we're facing now is that in the same implementation of a RadGrid, getting the index of the selected row was zero based in our existing code (older version of Telerik). However, implementing the same using the new version of Telerik (2014.1.513.40) will return an incremented result.
For example, if the first row of the grid is selected, in the old version the index value was zero, but in the new version it returns 1.
This is the implementation of my RadGrid:
<telerik:RadGrid GridLines=
"none"
ID=
"RadGrid1"
runat=
"server"
AllowMultiRowSelection=
"true"
AllowPaging=
"true"
AllowCustomPaging=
"true"
AllowSorting=
"true"
AllowAutomaticDeletes=
"true"
AutoGenerateColumns=
"true"
ShowStatusBar=
"false"
OnNeedDataSource=
"RadGrid1_NeedDataSource"
OnItemDataBound=
"RadGrid1_ItemDataBound"
OnItemCommand=
"RadGrid1_ItemCommand"
OnGroupsChanging=
"RadGrid1_GroupsChanging"
OnColumnCreated=
"RadGrid1_ColumnCreated"
OnDataBound=
"RadGrid1_DataBound"
OnSortCommand=
"RadGrid1_SortCommand"
OnItemCreated=
"RadGrid1_ItemCreated"
OnPreRender=
"RadGrid1_PreRender"
HorizontalAlign=
"NotSet"
Visible=
"false"
>
<ClientSettings AllowColumnHide=
"true"
AllowColumnsReorder=
"true"
AllowDragToGroup=
"true"
ReorderColumnsOnClient=
"true"
AllowKeyboardNavigation=
"true"
AllowRowsDragDrop=
"true"
AllowAutoScrollOnDragDrop=
"false"
EnablePostBackOnRowClick=
"false"
EnableRowHoverStyle=
"true"
>
<Resizing AllowColumnResize=
"true"
EnableRealTimeResize=
"true"
ResizeGridOnColumnResize=
"true"
/>
<Selecting AllowRowSelect=
"true"
/>
<Scrolling UseStaticHeaders=
"true"
SaveScrollPosition=
"true"
AllowScroll=
"true"
/>
<ClientEvents OnRowContextMenu=
"RadGrid1_RowContextMenu"
OnRowDropping=
"RadGrid1_RowDropping"
OnActiveRowChanged=
"RadGrid1_ActiveRowChanged"
OnRowSelected=
"RadGrid1_RowSelected"
OnRowDblClick=
"RadGrid1_RowDblClick"
OnKeyPress=
"RadGrid1_KeyPress"
OnCommand=
"RadGrid1_Command"
OnRowClick=
"rowClick"
OnRowMouseOver=
"RowMouseOver"
OnRowMouseOut=
"RowMouseOut"
OnMasterTableViewCreated=
"RadGrid1_MasterTableViewCreated"
/>
</ClientSettings>
<MasterTableView AllowMultiColumnSorting=
"false"
DataKeyNames=
"ID,Unread,FolderPath"
Width=
"100%"
ClientDataKeyNames=
"ID,Unread,FolderPath"
TableLayout=
"Fixed"
>
<PagerStyle Mode=
"NextPrevNumericAndAdvanced"
PageButtonCount=
"3"
AlwaysVisible=
"true"
/>
</MasterTableView>
</telerik:RadGrid>
This is how I am getting the index from js:
function
RadGrid1_RowSelected(sender, eventArgs)
{
var
mst = sender.get_masterTableView();
var
index = eventArgs.get_gridDataItem().get_element().rowIndex;
}
I would like to know if the behavior of the RadGrid has been changed since the older version, or I am doing something wrong here.
Thank you.