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>
Hi,
Perhaps your TransactionAttachment resource isn't being found?
Is your ValueConverter's Convert method being called?
-SteveZ
Yes it is being called. I stepped through it. When I examine the value parameter, it is of type UnboundColumnDataContext. The key property is set correctly ("Attachment" - the key for the column), but both the RowData and Value properties are nothing.
Do you have a sample that i could look at?
I'm unable to reproduce what you're seeing.
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.
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 downloaded and installed it and now it works perfectly.
Thanks.
Service Release has just been released, you can go to the download site and get it.
Build numbers are:
HTH,
Hi Stoimen,
Thanks, I will test it as soon as the service release is available.
Remko
As SteveZ mentioned above, the type of the object which is passed in to the Convert() method shound not be of type UnboundColumnDataContext, but of the type of your data object.
I managed to reproduce a case where the Convert() method is being called with value of type UnboundColumnDataContext (with the build numbers you provided), so I think that's the issue you are running into.
I verified that this issue is fixed with the latest Service Release which is comming very soon.
I hope your issues will be solved,
I'm having the same issue with version 10.2.20102.1029. Was this problem solved by anyone?