Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6364691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:11:51+00:00 2026-05-25T00:11:51+00:00

I want to show a poll result for a specific poll question. When question

  • 0

I want to show a poll result for a specific poll question.
When question list clicked i want to bind my chart with a query according to selected questionId.

So my plan was;
1. get questionId from selected question row. it’s ok.

  1. defining ClientEvents.OndataBinding event on my chart. So i would be able to
    pass questionId with;

    function onChartDataBinding(e) {
    e.data = $.extend(e.data, { questionId: questionId });
    }

  2. using $('#ChartPollResults').data('tChart').rebind(); on question list grid row selected event.

This scenario works when i have second grid binding according to first grids selected row.
But it seems there is no ClientEvents.OnDataBinding event on chart control.
And “rebind()” method isn’t supported on Chart control.

The chart conrol i use is below.

@(Html.Telerik().Chart<QuestionResult>()
                            .Theme("WebBlue")
                            .Name("ChartPollResults")
                            .Title("Poll Question Choice Number vs. Choice Count")
                            .Legend(legend => legend.Position(ChartLegendPosition.Bottom))
                            .Series(series =>
                            {
                                series.Bar("ChoseCount").Name("Choice Count").Gap(5);
                            })
                            .CategoryAxis(axis => axis.Categories(o => o.ChoiceNumber))

                            .DataBinding(dataBinding => dataBinding.Ajax().Select("_PollResultChartBinding", "Poll", new { questionId = 0 }))
                            .HtmlAttributes(new { style = "width: %100px; height: 270px" })
                    )

My Controller binding method;

public ActionResult _PollResultChartBinding(int questionId = 0)
{
            //questionId = 3;
            if (!ModelState.IsValid || questionId == 0)
                return Json(new List<QuestionResult>());

            PollQuestionDefinition pollQuestion = service.Get(questionId);
            List<PollAnswer> pollAnswers = service.GetPollAnswersByQuestion(questionId);
            PollQuestionResultUI result = new PollQuestionResultUI(pollQuestion, pollAnswers);

            return Json(result.Results);
}

When i comment out //questionId = 3; line i can see the results for the question wiht Id= 3 in chart with no problem.

But i can’t pass questionId to chart.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:11:52+00:00Added an answer on May 25, 2026 at 12:11 am

    First of all, one thing I immediately noticed is that you set questionId equal to 0 in your ActionResult parameters. I actually just modified a Chart I had up and running to pass in

    new { questionID = 0}
    

    as an additional parameter to my Ajax select statement and it passed in fine.

    As for passing the parameter you could consider using a POST to the server on Grid selection and pass the parameter that way. I know it might not be ideal here, but you could theoretically either populate the Chart in that post, or just set a ViewData entry to contain the particular questionID that you are looking for.

    I also noticed that you submitted this to the Telerik forums and from the response there it would seem that the above approach might actually work pretty well, or you could use the approach mentioned there (partial view with ajax calls).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a little Problem with a MDX-Query . I want show all the
I've to following question. I've a multiple listitem and i want show the three
i want to hide and show my text box according to drop down select
hii I want show a pop up Dialog box when i click on to
I want to show HTML content inside Flash. Is there some way to do
I want to show a chromeless modal window with a close button in the
I want to show the publish date in the About dialog.
...I want to Show the 'delete' button when user is an admin, and show
We want to show a hint for a JList that the user can select
I want to show a table of fixed width at the center of browser

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.