Tree column frustrations

8 posts, 0 answers
  1. Matt
    Matt avatar
    24 posts
    Member since:
    Sep 2009

    Posted 09 Jul 2012 Link to this post

    I'm frustrated with the tree column for the GanttView as well as Cell templates within all columns.

    I'd like to have the tree column be un-frozen, not necessarily be the first visible column, and not necessarily be bound to title.

    I tried changing the MemberBinding of the TreeColumnDefinition to point to a different property but it still seems to go after the Title property. I tried adding a Cell Template similar to this:

    <telerik:TreeColumnDefinition MemberBinding="{Binding WBS}" Header="WBS" ColumnWidth="60">
      <telerik:TreeColumnDefinition.CellTemplate>
        <DataTemplate>
          <TextBlock Text="{Binding WBS}" />
        </DataTemplate>
      </telerik:TreeColumnDefinition.CellTemplate>
    </telerik:TreeColumnDefinition>

    But that binding was invalid. Not being able to access my data item from within a DataTemplate is a pretty bad thing in my opinion and a severe limitation of the control in its current form.

    I don't like that the TreeColumn is frozen and leftmost and would like to be able to change this behavior. The frozen isn't as bad as the leftmost behavior. 

    Is there any way in the current code to have the TreeColumn point at something other than Title? How do I get at my data item from within a DataTemplate? The data context doesn't appear to be correct.
  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 10 Jul 2012 Link to this post

    Hello Matt,

    The RadGanttView is still under beta stage and some behaviors and APIs are still being reconsidered. In particular we are still researching what is the best way to define this tree column and your opinion is greatly appreciated. Could you please give us some more details on what kind of columns would you like to precede the tree column and would you like them to be frozen or you would like to scroll all the columns with a single scroll?

    About the DataContexts issue - we decided that as this column is meant to hold the titles of the rows it should have different DataContext - this is a GroupInfo object which will hold different data when the RosourceView is ready. Currently you could use the following cell template:
    <telerik:TreeColumnDefinition Header="Task title" ColumnWidth="200">
        <telerik:TreeColumnDefinition.CellTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding Header.WBS}" />
            </DataTemplate>
        </telerik:TreeColumnDefinition.CellTemplate>
    </telerik:TreeColumnDefinition>

    Hope this helps.

    Kind regards,
    Miroslav Nedyalkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Matt
    Matt avatar
    24 posts
    Member since:
    Sep 2009

    Posted 10 Jul 2012 Link to this post

    Sure. I'd love to have a row indicator column as the first column with either the row number or a WBS number for a task as the first column, a column with multiple icons in it (similar to MS Project) representing a task's status / milestone nature / attachments / whatever, and then a Title column (hopefully with a tree structure in that column).

    Of course, I'd love columns to be re-orderable and resizable, too.

    Your suggestion to use the header property does help with the tree column. I am still having some issues with normal columns, though. For example, I'm trying to add a control to the cell template of a cell and pass in the row's item as a property on that control, but I can't quite get things working. Even simple things like trying to bind a textblock to a property inside of a cell template don't seem to work in these circumstances. Things do work better inside of CellEditTemplates.

    <telerik:ColumnDefinition Header="Icons" ColumnWidth="100" MemberBinding="{Binding}">
      <telerik:ColumnDefinition.CellTemplate>
        <DataTemplate>
          <mystuff:TaskIcons Task="{Binding}" />
        </DataTemplate>
      </telerik:ColumnDefinition.CellTemplate>
    </telerik:ColumnDefinition>
  5. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 10 Jul 2012 Link to this post

    Hello Matt,

    Thank you for your feedback - we will take it in advance.

    About the CellTemplate - currently it is using the MemberBinding property to evaluate the value and the only property of the DataContext of the CellTemplate is the Value property which is the evaluated value. We decided to change this as it is not very intuitive and make it work like the CellEditTemplate, but the change will be included in the 2012 Q2 SP1. You could try the changed version using the latest internal build. Please notice that the DataContext is still not the actual task, but a proxy object used for performance which implements the most common properties, but also has a property called OrigianlEvent which holds the task and FormattedValue which holds the result from the MemberBinding.

    Hope this information is helpful.

    All the best,
    Miroslav Nedyalkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. stefano
    stefano avatar
    6 posts
    Member since:
    Apr 2011

    Posted 29 Nov 2012 Link to this post

    Hello,
      I'm using version Q3 2012 but the behaviour is not changed .... 
    I completely agree that it shoud be changed, I'd like to resize the columns width, filtering the rows and use binding to the properties of the datacontext without using the "OriginalEvent" !! (it's one whole day that I'm trying find how to set the datatemplate binded to a  my property and not to the "Title" :-S  )

  7. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 29 Nov 2012 Link to this post

    Hello Stefano,

    We decided to go back the original version including the FormattedValue property (the Value calculated and formatted according to the MemberBinding) and to include the OriginalEvent only in case. We decided to do so for two main reasons:
    - As we reuse the same mechanism for the mouse-over and selected cells, we need both - reflect the MemberBinding and CellTemplate and this was the most appropriate solution we found - to use a proxy object which contains the formatted value
    - Using Binding directly to the item will cause huge performance penalty, so we decided to sacrifice the nice looking Template for the sake of better performance

    Hope this makes sense.

    All the best,
    Miroslav Nedyalkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  8. stefano
    stefano avatar
    6 posts
    Member since:
    Apr 2011

    Posted 30 Nov 2012 Link to this post

    Hi Miroslav, 
      it make sense, but this thread is the only place where this behaviour is documented .... (or the only that I found :-S). Maybe an example in the tutorials  would be appreciated.

    My only thought was that it was simpler if the "grid" of the GanttViewer would have the same behaviour of the GridViewer control, at the moment it seems quite triky to use and with less functionalities.

    My 2 cents
      Stefano
  9. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 04 Dec 2012 Link to this post

    Hi Stefano,

    Thank you for your feedback. We will definitely improve the help of the GanttView control and reflect this tricky part (the CellTemplate) in it.

    About the consistency - I completely understand you, but we decided to trade this consistency for performance which could not be achieved using the other approach (with direct bindings).

    All the best,
    Miroslav Nedyalkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
UI for WPF is Visual Studio 2017 Ready