I've had a tough time trying to figure out how to access my grid on client side. I've tried everything I could find, and nothing seems to work. I FINALLY got my grid object ($find didn't work for me), but now get_masterTableView() isn't doing anything. If I step through the javascript, it steps into the line and just disappears into some WebResource.axd abyss and never returns. I don't get any javascript errors.
If I try to run the function in the console, it says "undefined is not a function".
Here's my code
If I try to run the function in the console, it says "undefined is not a function".
Here's my code
<script type=
"text/javascript"
>
function
GridCreated(grid) {
var
mtv = grid.get_masterTableView();
var
pageIndex = mtv.get_currentPageIndex();
alert(pageIndex);
}
</script>
<
radG:RadGrid
ID
=
"rgResults"
runat
=
"server"
AllowMultiRowSelection
=
"True"
AllowPaging
=
"True"
AllowSorting
=
"True"
EnableAJAX
=
"False"
GridLines
=
"None"
OnItemCommand
=
"rgResults_ItemCommand"
OnItemDataBound
=
"rgResults_ItemDataBound"
PageSize
=
"20"
Skin
=
"Default"
Width
=
"100%"
OnPageIndexChanged
=
"rgResults_PageIndexChanged"
OnSortCommand
=
"rgResults_SortCommand"
OnInit
=
"rgResults_Init"
OnPreRender
=
"rgResults_PreRender"
>
<
ClientSettings
ApplyStylesOnClient
=
"True"
>
<
ClientEvents
OnGridCreated
=
"GridCreated(this);"
/>
</
ClientSettings
>
<
ItemStyle
CssClass
=
"griditemtext"
/>
<
HeaderStyle
CssClass
=
"gridheadertext"
/>
<
FooterStyle
CssClass
=
"gridfootertext"
/>
<
AlternatingItemStyle
CssClass
=
"gridalternetitemtext"
/>
<
PagerStyle
CssClass
=
"gridpagertext"
Mode
=
"NumericPages"
/>
<
CommandItemStyle
CssClass
=
"gridcommandtext"
/>
<
SelectedItemStyle
CssClass
=
"gridselecteditemtext"
/>
<
MasterTableView
AutoGenerateColumns
=
"False"
DataKeyNames
=
"Article Number"
Font-Bold
=
"False"
Font-Italic
=
"False"
CommandItemDisplay
=
"None"
Font-Overline
=
"False"
Font-Strikeout
=
"False"
Font-Underline
=
"False"
GridLines
=
"Both"
>
<
ExpandCollapseColumn
Visible
=
"False"
>
<
HeaderStyle
Width
=
"19px"
/>
</
ExpandCollapseColumn
>
<
RowIndicatorColumn
Visible
=
"False"
>
<
HeaderStyle
Width
=
"20px"
/>
</
RowIndicatorColumn
>
<
PagerStyle
Mode
=
"NumericPages"
/>
<
Columns
/>
</
MasterTableView
>
</
radG:RadGrid
>