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

MVVM ColumnDefinitions

1 Answer 65 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
robert
Top achievements
Rank 1
robert asked on 29 Aug 2014, 08:48 AM
Hello, is there a possibility to bind a list of columndefinition in viewmodel on GanttGrid without direct access to the gantcontrol (gantt.Columns.add)?
Best Regards Robert ...
public void InitGanttColumns()
        {
            //Title ----
            ColumnDefinition GanttColumn = new TreeColumnDefinition();
            GanttColumn.Header = "Title";
            GanttColumn.Width = 200;
            GanttColumn.MemberBinding = new Binding("Title");
            GanttColumns.Add(GanttColumn);
     
            // Start ----
            GanttColumn = new ColumnDefinition();
            GanttColumn.Header = "Start";
            GanttColumn.Width = 100;
 
            var itemsBinding = new Binding("Start")
            {
                Converter = new GanttModuleTypeConverter(),
                ConverterParameter = "date"
            };
 
            GanttColumn.MemberBinding = itemsBinding;
            GanttColumns.Add(GanttColumn);
             
            // End ----
            GanttColumn = new ColumnDefinition();
            GanttColumn.Header = "End";
            GanttColumn.Width = 100;
 
            itemsBinding = new Binding("End")
            {
                Converter = new GanttModuleTypeConverter(),
                ConverterParameter = "date"
            };
 
            GanttColumn.MemberBinding = itemsBinding;
            GanttColumns.Add(GanttColumn);
        }

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 01 Sep 2014, 08:43 AM
Hello Robert,

I am afraid that Columns property of the GanttView is not bindable, You could try to implement the needed approach with attached property as demonstrates in the following blog post;
http://blogs.telerik.com/xamlteam/posts/13-01-14/extending-the-functionality-of-radcontrols-with-attached-properties

However, please note that we haven't tested this and we cannot guarantee that it will work without any problems.

Regards,
Yana
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
GanttView
Asked by
robert
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or