[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Silverlight 4 DataGrid Column Text not displaying

Posted on 2011-04-22
3
Medium Priority
?
843 Views
Last Modified: 2012-05-11
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
Comment
Question by:jackwebb22002
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
hiteshgoldeneye earned 2000 total points
ID: 36286886
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
 

Author Closing Comment

by:jackwebb22002
ID: 36323814
Thanks much,
0
 
LVL 13

Expert Comment

by:hiteshgoldeneye
ID: 36324042
Most welcome, glad i could help!!
0

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question