gunnerz
gunnerz

Reputation: 1926

Telerik ASP .NET controls

I want to create an Organisation chart in my ASP MVC application. We have got licence for telerik AJAX controls - which has Organisation chart control.

Does anyone know if we can use Telerik ASP.NET controls in an MVC application?

Thanks

Upvotes: 1

Views: 1120

Answers (3)

David Bell
David Bell

Reputation: 86

In a nutshell, yes.

We've not used the Org Charts but we have used a number of the Telerik asp.net ajax controls (Calendars, Grids and Treeviews for the most recent release) within the views of our MVC project.

You simply need the reference to the Telerik.Web.UI within the view.

Basic code to show the calendar in use:

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<asp:Content ID="aboutTitle" ContentPlaceHolderID="TitleContent" runat="server">
    About Us
</asp:Content>

<asp:Content ID="aboutContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>About</h2>
    <p>
        Put content here.
    </p>
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />

    <telerik:RadCalendar ID="RadCalendar1" runat="server" TitleFormat="MMMM yyyy" CultureInfo="English (United States)"
        PresentationType="Preview" EnableNavigation="false" EnableMonthYearFastNavigation="false">
    </telerik:RadCalendar>
</asp:Content>

Upvotes: 1

Kane
Kane

Reputation: 16802

Whilst not really answering your question you could not use the Telerik controls but instead use JavaScript libraries offered by Google (for free).

Here is sample code taken from Google's site.

<html>
  <head>
    <script type='text/javascript' src='https://www.google.com/jsapi'></script>
    <script type='text/javascript'>
      google.load('visualization', '1', {packages:['orgchart']});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Name');
        data.addColumn('string', 'Manager');
        data.addColumn('string', 'ToolTip');
        data.addRows([
          [{v:'Mike', f:'Mike<div style="color:red; font-style:italic">President</div>'}, '', 'The President'],
          [{v:'Jim', f:'Jim<div style="color:red; font-style:italic">Vice President</div>'}, 'Mike', 'VP'],
          ['Alice', 'Mike', ''],
          ['Bob', 'Jim', 'Bob Sponge'],
          ['Carol', 'Bob', '']
        ]);
        var chart = new google.visualization.OrgChart(document.getElementById('chart_div'));
        chart.draw(data, {allowHtml:true});
      }
    </script>
  </head>

  <body>
    <div id='chart_div'></div>
  </body>
</html>

Upvotes: 1

Curtis
Curtis

Reputation: 103348

Telerik have an ASP.NET MVC section which shows use of charts:

http://www.telerik.com/products/aspnet-mvc.aspx

However I think you'll have to check with them as to whether this is part of your licence.

Upvotes: 2

Related Questions