How to properly inherit from a telerik component?

1 Answer 54 Views
GanttView
Althos
Top achievements
Rank 1
Althos asked on 17 Oct 2022, 10:20 PM

Hi,    

I'm trying to create a custom component that inherits from RadGanttView, but I'm not sure what the intended workflow is intended to be. Namely to set my columns, rows, taskssource,... up. Here are the steps that I took:  

1- Create a "CustomGantt.cs" class that inherits from RadGanttView   

2- Create a Generic.xaml file. Within that file, create a style that targets CustomGantt and is based on the default RadGanttViewStyle   

3- Add said Generic.xaml file to my App.Resources   

Now I can add my CustomGantt control to any of my views, and it does display a Gantt as intended, however, this, is not enough as I've yet to define my columns, rows, source,.... But I'm unsure of what the best way to do that is supposed to be. Should I create a ControlTemplate within my Generic.xaml file in which I add a RadGanttView that I can then set up?     

Thanks a lot for your help!

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 19 Oct 2022, 12:34 PM

Hi Althos,

Generally speaking, apart from inheriting the RadGanttView class and applying the default style for the theme you're using (when using the NoXaml binaries), you can still use the custom gantt control as you would do with the standard RadGanttView.

To demonstrate this, I've prepared a small sample project which simply inherits the RadGanttView class, assigns a TasksSource, and defines some columns.

Please have a look and let me know if you find this helpful. If this differs from the setup at your end and you observe any issues with the custom implementation, please update this project to better resemble your scenario and send it back to me for further investigation. I will be awaiting your reply.

Regards,
Dilyan Traykov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
GanttView
Asked by
Althos
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or