I have a valueconverter attached to an unbound column in a xamwebgrid. When i debug the valueconverter, the UnboundColumnDataContext.RowData and Value are both nothing. Here is the Xaml. Maybe I have not set this up correctly:
<ig:UnboundColumn Key="Attachment" HeaderText="" IsSummable="False" ValueConverter="{StaticResource TransactionAttachment}"> <ig:UnboundColumn.ItemTemplate> <DataTemplate> <Image Stretch="Fill" Width="16" Height="16" Source="{Binding RowData}" /> </DataTemplate> </ig:UnboundColumn.ItemTemplate></ig:UnboundColumn>
It looks like I have the most recent release. My components have a version of 10.1.20101.2022.
I thought an unbound column was supposed to make use of an unboundcolumndatacontext? I'll check and see if the service release I installed was the latest.
Hmm...
That appears to be the issue, The value being returned in the Converter should not be a UnboundColumnDataContext, it should be the data for that particular row.
Are you using the latest Service Release?
-SteveZ
Here's the convert function:
Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert Dim t As Transaction = DirectCast(DirectCast(value, Infragistics.Silverlight.UnboundColumnDataContext).RowData, Transaction) Dim ctx As ComdataDS = DirectCast(parameter, ComdataDS) If ctx.Documents.Select(Function(d) d.TransactionKey = t.TransactionKey).Count > 0 Then Return New Uri(Application.Current.Host.Source, "../images/attachment.png") Else Return String.Empty End IfEnd Function
I don't. Its on my development machine. Don't know if it matters, but the ItemsSource for the grid is set at runtime - its a linqtosql entity (ria service). I tried setting the valueconverter both at runtime and in xaml but it didn't make any difference. That particular grid makes use of several valueconverters all of which are working properly, but none of them are on unbound columns.