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

Gantt : ActiveRegionUrl

1 Answer 21 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Alec
Top achievements
Rank 1
Alec asked on 15 Jul 2011, 06:05 PM
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;
    rcCampaign.Series[0].Items.Add(chartItem);
}

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!

Alec.

1 Answer, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 21 Jul 2011, 04:19 PM
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,
Tsvetie
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!

Tags
Chart (Obsolete)
Asked by
Alec
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Share this question
or