Home Forums WPF controls Xceed DataGrid for WPF Column with CellContentTemplateSelector binding problems

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #25645 |

    I am using Xceed DataGrid 1.3 with Visual Studio 2008 RTM and .NET 3.5. The problem is that my DataTemplateSelector SelectTemplate always gets an object of type string that is empty. Is something wrong with the column binding to a cellcontenttemplateselector?

    Here is more detail.

    I have a DataGridCollectionViewSource that I am binding to the following DataGrid

    <xcdg:DataGridControl x:Name=”ReadOnlyGrid”
    AutoCreateColumns=”False”
    ReadOnly=”True”
    ItemsSource=”{Binding Source={StaticResource cvsFacility}}”
    SelectionMode=”Single”
    Margin=”0″>

    One of my columns looks like this
    <xcdg:Column FieldName=”Status” Title=”Status” DisplayMemberBinding=”{Binding Path=Status}” CellContentTemplateSelector=”{StaticResource StatusTemplateSelector}” />

    Status is an enum but that doesn’t seem to matter since I made it a string and I have the same problem. Now when the SelectTemplate method gets called

    public override DataTemplate SelectTemplate(object item, DependencyObject container)

    The item is always a empty string.

    Any ideas?

    Scott

    Imported from legacy forums. Posted by Scott (had 3146 views)

    Xceed Support
    Member
    Post count: 5658

    I will be investigating this to see if I can reproduce… I’ll let you know if I can find something.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 389 views)

    User (Old forums)
    Member
    Post count: 23064

    Scott,

    Is the item *always* an empty string? It might be an empty string while the DataCell’s binding has not yet been evaluated, but it should be the proper data item once the binding has kicked in.

    Imported from legacy forums. Posted by Pascal (had 865 views)

    User (Old forums)
    Member
    Post count: 23064

    Scott, and others…. did anyone figure this out? I’ve just run into exactly the same scenario. I’m building my own columns manually, trying to use a DataTemplateSelector and getting an empty string as the item.

    Does this have anything to do with building columns manually, rather than leaving AutoCreateColumns to true?

    Any ideas on how to proceed?

    Thanks,
    -Amy-

    Imported from legacy forums. Posted by Amy (had 4460 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.