• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 858
  • Last Modified:

Silverlight 4 DataGrid Column Text not displaying

I have a Silverlight 4 Business Application using RIA Services.  in particular, two of the columns represent objects.  I'm trying to display the value of the columns with a Binding="{Binding Path=StatusOfJob.StatusId}" and the other as Text="{Binding Path=OtherRequest.OtherRequestText}".  Both of the colums show up as blank.  But oddly enough, they did work in a version of the application which was first constructed using VS 2010.  once i learned that SP1 was available, i installed it, and re-built my application using SP1.  The old version still works, but the new version (SP1) does not.

Any help would be most appreciated, and in the xaml, the two colums to look at are x:Name="OtherRequestName" and x:Name="statusColumn"
<navigation:Page xmlns:my2="clr-namespace:agmaSodium.Controls"  x:Class="agmaSodium.Views.Contractor" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:dds="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="640" d:DesignHeight="480"
           Title="Contractor Page" xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices" 
            xmlns:my="clr-namespace:agmaSodium.Web.Models" 
            xmlns:my1="clr-namespace:agmaSodium.Web.Services" 
            xmlns:web="clr-namespace:agmaSodium.Web.Services"
            xmlns:ex="clr-namespace:ComboBoxExtensions;assembly=ComboBoxExtensions"
            xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">
    <navigation:Page.Resources>
        <web:agmaSodiumDomainContext x:Key="agmaSodiumDomainContext"/>
        <dds:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance my:QJob, CreateList=true}" 
                        Height="0" LoadedData="qJobDomainDataSource_LoadedData" x:Name="qJobDomainDataSource" 
                        QueryName="GetQJobsByContractorQuery" Width="0" LoadSize="40" PageSize="20"
                        DomainContext="{StaticResource agmaSodiumDomainContext}">
            <dds:DomainDataSource.SortDescriptors>
                <dds:SortDescriptor PropertyPath="Status" Direction="Ascending" />
                <dds:SortDescriptor PropertyPath="Job_Number" Direction="Ascending" />
            </dds:DomainDataSource.SortDescriptors>
        </dds:DomainDataSource>
        <ex:ComboBoxDataSource x:Name="otherRequestDataSource" OperationName="GetOtherRequestsQuery" 
                                       DomainContext="{StaticResource agmaSodiumDomainContext}"/>
    </navigation:Page.Resources>
    <Grid x:Name="LayoutRoot" HorizontalAlignment="Stretch">
        <StackPanel x:Name="ContentStackPanel" Style="{StaticResource ContentStackPanelStyle}" Width="Auto" Margin="0" HorizontalAlignment="Left" Height="Auto">
            <TextBlock x:Name="HeaderText" Style="{StaticResource HeaderTextStyle}" Text="{Binding Path=ApplicationStrings.ContractorPageTitle}"/>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Name="stkPnlBtns">
                <Button Name="btnEditSelectedJob" Content="Edit Selected Job Details" Width="Auto" Height="23" Margin="2,0,0,0" Click="btnEditSelectedJob_Click" />
                <Button Name="btnExpandGroup" Click="btnExpandGroup_Click" Content="Expand Groups" Width="Auto" Height="23" Margin="2,0,0,0" />
                <Button Name="btnCollapseGroup" Click="btnCollapseGroup_Click" Content="Collapse Groups" Width="Auto" Height="23" Margin="2,0,0,0" />
                <Button Name="btnCreateNewJob" Click="btnCreateNewJob_Click" Content="Create New Job" Width="Auto" Height="23" Margin="2,0,0,0" />
                <Button Name="btnSubmitChanges" Click="btnSubmitChanges_Click" Content="Submit Changes" Width="Auto" Height="23" Margin="2,0,0,0" />
                <Button Name="btnExportToExcel" Click="btnExportToExcel_Click" Content="Export To Excel" Width="Auto" Height="23" Margin="2,0,0,0" />
                <Button Name="btnPhilaZipCodeMap" Click="btnPhilaZipCodeMap_Click" Content="Philadelphia Zip Code Map" Width="Auto" Height="23" Margin="2,0,0,0" />
            </StackPanel>
            <my2:BusyIndicator x:Name="jobLoadBusy">
            <sdk:DataGrid AutoGenerateColumns="False" Height="Auto" HorizontalAlignment="Left" 
                          ItemsSource="{Binding ElementName=qJobDomainDataSource, Path=Data}" Margin="0" Name="qJobDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected" VerticalAlignment="Top" Width="Auto" Loaded="qJobDataGrid_Loaded">
                <sdk:DataGrid.Columns>
                <sdk:DataGridTextColumn x:Name="Job_NumberColumn" Binding="{Binding Path=Job_Number}" Header="Job Number" Width="Auto" IsReadOnly="True" CanUserSort="True" />
                <sdk:DataGridCheckBoxColumn x:Name="confirmNeededColumn" Binding="{Binding Path=ConfirmNeeded}" Header="Confirm Needed" Width="Auto" IsReadOnly="True" CanUserSort="True" />
                <sdk:DataGridTextColumn x:Name="name_of_JobColumn" Binding="{Binding Path=Name_of_Job}" Header="Name of Job" Width="Auto" IsReadOnly="False" CanUserSort="True" />
                <sdk:DataGridTextColumn x:Name="statusColumn" Binding="{Binding Path=StatusOfJob.StatusId}" Header="Status" IsReadOnly="True" CanUserSort="True" />
                <sdk:DataGridTemplateColumn x:Name="startDateColumn" Header="Start" Width="Auto" CanUserSort="True">
                    <sdk:DataGridTemplateColumn.CellEditingTemplate>
                        <DataTemplate>
                            <sdk:DatePicker SelectedDate="{Binding Path=StartDate, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellEditingTemplate>
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=StartDate, StringFormat=\{0:d\}}" VerticalAlignment="Center" />
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                </sdk:DataGridTemplateColumn>
                <sdk:DataGridTemplateColumn x:Name="completionDateColumn" Header="Completion" Width="Auto" CanUserSort="True">
                    <sdk:DataGridTemplateColumn.CellEditingTemplate>
                        <DataTemplate>
                            <sdk:DatePicker SelectedDate="{Binding Path=CompletionDate, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellEditingTemplate>
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=CompletionDate, StringFormat=\{0:d\}}" VerticalAlignment="Center" />
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                </sdk:DataGridTemplateColumn>
                <sdk:DataGridTemplateColumn x:Name="OtherRequestName" Header="Other Request" CanUserSort="True">
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=OtherRequest.OtherRequestText}"/>
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                    <sdk:DataGridTemplateColumn.CellEditingTemplate>
                        <DataTemplate>
                            <!--<TextBlock Text="{Binding Path=OtherRequest.OtherRequestText}"/>-->
                                    <!--<ComboBox Name="cboOtherRequests"  ItemsSource="{Binding Path=OtherRequest, Mode=OneWay}"
                                              SelectedValue="{Binding Path=OtherRequest.OtherquestId, Mode=TwoWay}"
                                              DisplayMemberPath="OtherRequest.OtherRequestText"
                                              SelectedValuePath="OtherRequest.OtherRequestId"/>-->
                            <ComboBox Name="cboOtherRequests" 
                                                  ItemsSource="{Binding Data, Source={StaticResource otherRequestDataSource}}" 
                                                  SelectedItem="{Binding OtherRequest, Mode=TwoWay}"
                                                  ex:ComboBox.Mode="Async"/>
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellEditingTemplate>
                </sdk:DataGridTemplateColumn>
                <sdk:DataGridTemplateColumn x:Name="remPP1Column" Header="Remaining PP 1" Width="Auto" CanUserSort="True" IsReadOnly="True">
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=RemainingPP1, StringFormat=C0}" TextAlignment="Right" />
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                </sdk:DataGridTemplateColumn>
                <sdk:DataGridTemplateColumn x:Name="remPP2Column" Header="Remaining PP 2" Width="Auto" CanUserSort="True" IsReadOnly="True">
                    <sdk:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=RemainingPP2, StringFormat=C0}" TextAlignment="Right" />
                        </DataTemplate>
                    </sdk:DataGridTemplateColumn.CellTemplate>
                </sdk:DataGridTemplateColumn>
            </sdk:DataGrid.Columns>
            </sdk:DataGrid>
         </my2:BusyIndicator>
         <sdk:DataPager Height="26" HorizontalAlignment="Left" Margin="0" Name="dataPager1" PageSize="10" VerticalAlignment="Bottom" Width="Auto" />
        </StackPanel>
        <TextBlock Height="23" HorizontalAlignment="Stretch" Margin="3,426,10,0" Name="ChangeText" Text="" VerticalAlignment="Top" TextWrapping="Wrap" />
    </Grid>
</navigation:Page>

Open in new window

0
jackwebb22002
Asked:
jackwebb22002
  • 2
1 Solution
 
Hitesh ManglaniCommented:
Hi Jack,

Can you check whether the objects concerned implement the INotifyPropertyCHanged interface, if not can you implement the interface and check with help from the following link?
http://goldmanalpha.wordpress.com/2010/02/11/inotify/

Regards
Hitesh
0
 
jackwebb22002Author Commented:
Thanks much,
0
 
Hitesh ManglaniCommented:
Most welcome, glad i could help!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now