Hi,
Is there an example of the Xaml syntax for a multibinding valueconverter for an UnboundColumn or TextColumn for XamGrid?
Thanks
Hello James,
Thank you for your reply. I am very glad that the approach I have suggested was helpful for you. Please let me know if need any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Krasimir,
Thanks very much for your ehlp. That's exactly what I needed.
Hello Jim,
Thank you for your reply. I have been looking into it and the ValueConverter property of the TextColumn should be set to a IValueConverter instance, since it is used in the binding to the value of the cells of that column, which is not a MultiBinding and as I have mentioned, the IMultiValueConverter is used for MultiBinding only. What I can suggest in order to use binding, similar to the one that you have metioned, is using an UnboundColumn and defining your binding in its ItemTemplate. I have modified the sample application that I have previously attached, in order to demonstrates how you can use MultiBinding, in the ItemTemplate of an UnboundColumn.
Please let me know if need any further assistance on the matter.
Here is an example of the type of multivalueconverter I want to call:-
[
ValueConversion(typeof(object), typeof(string))]
public class LotConverter : IMultiValueConverter
{
#region
IMultiValueConverter Members
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
// Values coming in are:
//
// Lot
// LotSequence
string lot = values[0] as string;
int? lotSequence = values[1] as int?;
return (String.Format("{0}/{1}", lot, lotSequence));
}
In a list control I use the following to call it:-
<DataTemplate x:Key="LotTemplate">
<TextBlock>
<TextBlock.Text>
<MultiBinding Converter="{StaticResource lotConverter}">
<Binding Path="LotCode"/>
<Binding Path="LotSequence"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</DataTemplate>
How do i do this when using an Xamgrid. In the example below I'm calling a valueconverter as I'm only need to pass in a single value. how do I do it if I need to pass in more than one value?
<
ig:ColumnLayout.Columns>
<ig:TextColumn Key="ShiftId" HeaderText="Shift" ValueConverter="{StaticResource shiftTitle}" IsReadOnly="True"/>
Regards
jim
Thank you got your reply. I have been looking into it and I am not completely sure when in the XamGrid you are trying to use IMultiValueConverter. The IMultiuValueConverter is used to provide the ability to apply logic when you are using MultiBinding for a DependencyProperty. You can read more detailed description on that interface here: http://msdn.microsoft.com/en-us/library/system.windows.data.imultivalueconverter.aspx.
Would please provide me with more detailed description, where you creating using IValueConverter in the XamGrid and what is the MultiBinding that you are creating, for the IMultiValueConverter?
Looking forward to hearing from you.