DataBinding & IsEditable, multi columns

3 posts, 0 answers
  1. Denis
    Denis avatar
    12 posts
    Member since:
    May 2008

    Posted 05 Sep 2008 Link to this post

    Hi,

    I'm trying to use the RadTreeView by binding it to a collection of custom classes.
    TemplateSelector works fine for arbitrary depth and types to mimick WPF's "keyless" datatemplates.

    I do have heterogeneous data in my collections (basically, Tasks and People, with tasks & people as potential children of a task. Pretty basic stuff).

    I do have a few questions though:
    - I need to bind the text displayed in my node to the name property of the node (which is easy enough by using a hierarchicaldatatemplate with a HeaderTemplate containing a textblock bound to this property).

    The problem arises if I want to make use of the built-in edition system. How can I indicate to the system which property it is supposed to bind to for edition ?
    Additionnaly, is it possible to limit edition to a specific category of nodes (the tasks in my example) ?

    - Is there any way to come up with a column-treeview? (I know you must hear this one 10 times a day). There are samples out there for WPF, but the classes they use (from the GridView) are not public in Silverlight and they are tied to the GridView anyway.

    In any case, thanks for your great control libray !

    Edit: OK, I did answer my own first question by using the "PreviewEdited" event to carry out the operation manually.
  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 05 Sep 2008 Link to this post

    Hi Denis,

    You can see how the editing of the header of the tree view is done in our examples project that is downloaded with the controls. Basically the text that is displayed in the editable textbox is what RadTreeViewItem.ToString() method is returning, which by default is equal to what RadTreeViewItem.Header.ToString() is returning.

    An improvement to this mechanism could be when we start supporting the DisplayMemberPath property.

    About your second question - the multicolumn treeview. I'd love to hear your feedback about how important this is for you. We have created an example about how to create a multiple column treeview for WPF, but unfortunately we are missing the GridRowPresenter control from WPF in Silverlight. The problem in Silverlight is how to share the columns sizes between all the nodes, because not all nodes will have the same size for the columns. Currently you can easily create a fixed sized multicolumn treeview, but I'm not sure how useable this would be.

    Let me know your thoughts on this.

    Thanks!

    Regards,
    Valentin.Stoychev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Denis
    Denis avatar
    12 posts
    Member since:
    May 2008

    Posted 05 Sep 2008 Link to this post

    Thanks for your answers.

    For the edition, that's what I came to uderstand by playing a bit more with it.

    As for the multi column treeview, I actually have a use for it to display and edit  planning/budget information in my app.

    As I said, I found the WPF multicolumn treeview example and thought "great, it can be adapted", up until the point I realised Microsoft tied the GridRowPresenter and all that stuff to the DataGrid in silverlight, and made some of the classes private to top it off.

    I do like your treeview because it supports drag & drop out of the box and that saves me a huge amount of time.

    My other option is to base the design on the DataGrid and work from there. I did find some references on how to implement Drag & Drop for datagrid rows so it's worth considering. I'll have to see if I can get something remotely usable put of that.

    How would you go about creating a fixed size version by the way ? (my templating kung fu is not very strong I'm afraid...)




Back to Top