Home Forums WPF controls Xceed DataGrid for WPF Custom Control in Column.CellContentTemplate

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

    I have a star rating custom control which is working on property value setting and binding, outside of the grid, not in the datagrid.

    <xceed:Column FieldName=”StarRating” Title=”Rating” DisplayMemberBinding=”{Binding .}”>
    <xceed:Column.CellContentTemplate>
    <DataTemplate>
    <StackPanel>
    <c:Star Width=”100″ Height=”30″ Rating=”{Binding StarRating, Converter={StaticResource StarConverter}}” SelectStyling=”{StaticResource SelectedStyle1}” UnSelectStyling=”{StaticResource UnselectedStyle1}” HighLightStyling=”{StaticResource HighlightStyle1}” />
    </StackPanel>
    </DataTemplate>
    </xceed:Column.CellContentTemplate>
    </xceed:Column>

    The code above seems to be easy. But it simply can’t trigger the Star.Rating property SET value. Even if I hardcode a value Rating=”4″, it still doesn’t work.

    Wonder if anyone encountered this problem as well.

    Imported from legacy forums. Posted by Thien Pow (had 2517 views)

    Xceed Support
    Member
    Post count: 5658

    The CellContentTemplate only affects the way the content of a cell is displayed and does not have any imapct on how the content is edited. If by “set” you are trying to edit the value of the cell, then you will need to create a CellEditor in addition to the CellContentTemplate.

    Take a look at the <a href=”http://doc.xceedsoft.com/products/XceedWpfDataGrid/Custom%20Cell%20Editors.html”>Custom Cell Editors</a> topic for more information.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 336 views)

    User (Old forums)
    Member
    Post count: 23064

    I think I am not only missing the Cell Editor. I can’t even have the Star Rating control displaying the value correctly because it always display a 0 value eventhough I set the value Rating=4 in XAML.

    Please help :'(

    Imported from legacy forums. Posted by Thien Pow (had 3677 views)

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