I have a gridview im using to populate a chart. I use javascript to access the gridview to provide the data for the chart. The gridview sits in the main content holder for an aspx page.
I looked into using the raddock control and having the chart and gridview both display within a dock but when I have the gridview Inside the dock I cannot access it from within my .js file to get the data.
Could someone suggest a way to reference this control if possible?
Thanks
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"MainContent"
runat
=
"server"
>
<
asp:Panel
ID
=
"Panel3"
runat
=
"server"
><
br
>
<
asp:GridView
ID
=
"MyGridView"
runat
=
"server"
CssClass
=
"GridViewStyle"
GridLines="None" Width="100%" PageSize="100">
<
AlternatingRowStyle
CssClass
=
"AltRowStyle"
/><
br
>
<
EditRowStyle
CssClass
=
"EditRowStyle"
/>
<
EmptyDataRowStyle
CssClass
=
"EmptyRowStyle"
/><
br
>
<
HeaderStyle
CssClass
=
"HeaderStyle"
/><
br
>
<
PagerStyle
CssClass
=
"PagerStyle"
/><
br
>
<
RowStyle
CssClass
=
"RowStyle"
HorizontalAlign
=
"Center"
VerticalAlign
=
"Middle"
/>
<
SelectedRowStyle
CssClass
=
"SelectedRowStyle"
/><
br
>
</
asp:GridView
>
</
asp:Panel
>
</
asp:Content
>
var rows = $(
"#MainContent_MyGridView tr:gt(0)"
);//This is where I reference the gridview now.
var series = {
id:
'series'
,
name:
'MySeriesName'
,
data: []
}
rows.each(function (index) {
var myFloat = parseFloat($(
"td:nth-child(2)"
,
this
).text());
var myString = $(
"td:nth-child(1)"
,
this
).text();
series.data.push([myString, myFloat]);
});
I looked into using the raddock control and having the chart and gridview both display within a dock but when I have the gridview Inside the dock I cannot access it from within my .js file to get the data.
<telerik:RadDockZone Runat="server">
<telerik:RadDock ID="RadDock1" runat="server">
<ContentTemplate>
<div id="ChartRendersHere" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
<asp:Panel ID="Panel2" runat="server">
<asp:GridView ID="MyGridView" runat="server" CssClass="GridViewStyle"
GridLines="None" Width="100%" PageSize="100">
<AlternatingRowStyle CssClass="AltRowStyle" />
<EditRowStyle CssClass="EditRowStyle" />
<EmptyDataRowStyle CssClass="EmptyRowStyle" />
<HeaderStyle CssClass="HeaderStyle" />
<PagerStyle CssClass="PagerStyle" />
<RowStyle CssClass="RowStyle" HorizontalAlign="Center" VerticalAlign="Middle" />
<SelectedRowStyle CssClass="SelectedRowStyle" />
</asp:GridView> <asp:Panel ID="Panel1" runat="server">
</asp:Panel>
</asp:Panel>
</ContentTemplate>
</telerik:RadDock>
</telerik:RadDockZone>
Could someone suggest a way to reference this control if possible?
Thanks