Gantt : ActiveRegionUrl

Thread is closed for posting
2 posts, 0 answers
  1. Alec
    Alec avatar
    1 posts
    Member since:
    Jul 2011

    Posted 15 Jul 2011 Link to this post

    Hi there,

    I am trying to use the Gantt Chart to bind to a custom DataSource.  I then want the click event to navigate to a new URL (passing in the ID of the element that has been clicked).  Using ActiveRegionUrl='<%# Eval("RecordId", "campaignviewer.aspx?CampaignID={0}") %>' I get a message about the ChartSeries not having a DataBind method.

    I have also tried this by interrogating the ClickEventArgs on click, but cannot seem to get any sensical information from it (or set anything for that matter).

    Finally, I tried it without using automatic databinding as follows:

    foreach (CampaignHeader campaignItem in oCH)
        ChartSeriesItem chartItem = new ChartSeriesItem();
        chartItem.ActiveRegion.Url = string.Format("campaignviewer.aspx?CampaignId={0}", campaignItem.RecordId);
        chartItem.Name = campaignItem.CampaignName;
        chartItem.YValue = campaignItem.OAStart;
        chartItem.YValue2 = campaignItem.OAEnd;

    However in this way, I cannot set the label for each row and I also see a load of empty rows (labelled from 1 - 10).

    Any help would be gratefully appreciated!

  2. Tsvetie
    Tsvetie avatar
    1517 posts

    Posted 21 Jul 2011 Link to this post

    Hi Alec,
    Thank you for the detailed information. In short - you cannot use the data-binding expressions in this case and the correct approach would be to set it with code. Alternatively, you can use the DataBound event of the chart to set the active region url for the chart items and not create them manually.

    However, I cannot be sure, just by looking at the provided code fragment, why you end up with empty rows. That is why, it would be best, if you open a new support ticket and send me a running test project that demonstrates the problem, so that I can research it locally.

    Kind regards,
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top