This is a migrated thread and some comments may be shown as answers.

Regarding Rad html chart

3 Answers 42 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
mysoona
Top achievements
Rank 1
mysoona asked on 08 Aug 2014, 12:44 PM


Hi,

Good evening.

I need some technical help Regarding the chart.

I want to pass string value in the select parameter.

Link referred

http://demos.telerik.com/aspnet-ajax/htmlchart/examples/drilldownchart/defaultcs.aspx

 

In design:

here we have used the select parameter as year which is
integer(in my code I wnt to use string like ‘Monday’ and ‘july 2014’ how can I
achieve this),

<asp:SqlDataSource
ID="SqlDataSource2"
runat="server"
ConnectionString="<%$
ConnectionStrings:TelerikConnectionString %>"

          SelectCommand="SELECT
Sum(Revenue) as Rev, Quarter FROM Revenue WHERE Year=@Year GROUP BY
Quarter">

          <SelectParameters>

               <asp:Parameter Name="Year"></asp:Parameter>

          </SelectParameters>

     </asp:SqlDataSource>

 

Code behind:

 

Here I want to use the string value in the highlighted area as
mentioned above.Please help to fix this issue.

 

public
int Year

          {

               get

               {

                    if (ViewState["Year"]
== null)

                    {

                         return 2003;

                    }

                    return (int)ViewState["Year"];

               }

               set

               {

                    ViewState["Year"]
= value;

               }

          }

 

          protected
void RadAjaxManager1_AjaxRequest(object
sender,
AjaxRequestEventArgs e)

          {

               string
seriesName =
RadHtmlChart1.PlotArea.Series[0].Name;

 

               if
(seriesName ==
"Years")

               {

 

                    Year = int.Parse(e.Argument);

                    SqlDataSource2.SelectParameters[0].DefaultValue
= Year.ToString();

                    RadHtmlChart1.PlotArea.XAxis.DataLabelsField
= "Quarter";

                    RadHtmlChart1.PlotArea.Series[0].DataFieldY
= "Rev";

                    RadHtmlChart1.PlotArea.Series[0].Name
= "Quarters";

                    RadHtmlChart1.DataSourceID
= "SqlDataSource2";

               }

 

 

Thanks
& Regards

Mysoona

3 Answers, 1 is accepted

Sort by
0
mysoona
Top achievements
Rank 1
answered on 08 Aug 2014, 12:53 PM
wherever year comes i want to pass string value.So provide the suggestion asap.Its very critical.
0
mysoona
Top achievements
Rank 1
answered on 11 Aug 2014, 09:49 AM
hi can u please provide me some solution.Here instead of binding a chart in the series click i want to bind a radgrid.Suggest me a solution ASAP.Please.

Thanks in advance.
0
Danail Vasilev
Telerik team
answered on 12 Aug 2014, 12:15 PM
Hi Mysoona,

Your question is not directly related to Telerik UI controls but general ASP.NET knowledge related to configuring declarative data sources.

Nevertheless you may find useful this, this and this online resources that shed more light on the matter.


Regards,
Danail Vasilev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
mysoona
Top achievements
Rank 1
Answers by
mysoona
Top achievements
Rank 1
Danail Vasilev
Telerik team
Share this question
or