CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2011

    Question Binding to DataRowView with a DataTrigger inside of a DataGrid

    I am trying to implement a cell template for a datagrid. The problem is, when I try to bind to the Object within the datagridview, I am not getting the values that I am expecting.

    This is what the datagrid looks like with no styling:

    Pretty simple, but when I try to style it using a cell template with triggers, this is what I am getting (Each cell that has DAL.Task above should contain an orange circle):

    here is the xaml that I am using to style the grid:

    <DataTemplate x:Key="MiddleDataGridCellTemplate">
      <Image Name="CenterImage"
      <DataTrigger Binding="{Binding Row.ItemArray/TaskStatusName}"
       Value="In Progress">
       <Setter TargetName="CenterImage"
        Value="/besoControlLibrary;component/Resources/Spreadsheet_CheckedOut.png" />
    I am guessing that "{Binding Row.ItemArray/TaskStatusName}" is causing the problem, what is the correct way to pull out the TaskStatusName property of the DAL.Task within the datagridview?

    I found out that the values of the blank cells are DBNull if that helps at all.

    Also, these values are coming from a DataTable that is the context of the the DataGrid.

  2. #2
    Join Date
    May 2011

    Re: Binding to DataRowView with a DataTrigger inside of a DataGrid

    I solved the problem, answer here


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.