Hi Team,
I am currently using XamMultiColumnComboEditor inside XamGrid as I am new to WPF I not able to implement following things:
1. Enabling alternate Row Colors
2. Displaying multiple column data in the DisplayMemberPath
3. Display Selected items in XamMultiColumnComboEditor as Tooltip once the control is disabled (as the event like MouseEnter doesn't fire for disabled control)
- Can we use any cell event for XamGrid to fire and get selected data from the XamMultiColumnComboEditor and display in the tooltip?
4. Remove the Grid lines inside the Control (i.e. the lines between rows and columns)
5. Showing the full row as greyed out once the data is selected in the previous XamMultiColumnComboEditor, right now only the checkboxs are being unable for selection.Please help me with these issues. Thanks
Hi Maria,
Thanks for your input on this. I tried following the path that you mentioned in the sample project. But I am working on MVVM pattern. I tried using this handler method but upon assigning it to a ICommand Property and assigning a new delegate command to it then the Code breaks, as I guess it is due to the problem of missing Mouse event Arguments in Delegate command as I cannot convert a Method to Action<object>.
And If I assign the Property to Delegate Command and do not pass the arguments then the XAML breaks at </style> stating the Resources has not ended properly. but I checked all closing tags are fine.
Can you let me know an alternate method to assign either the handler in MVVM or get the Cell control and then use Visual Tree to get selecteditems with may be trigger or some other option.
Thanks
Hello Piyush,The TooltipService.ShowOnDisabled option allows you to force the tooltip to show even on a disabled control. Then, you can use a binding to bind the Tooltip's content to the SelectedItems property of the XamMultiColumnComboEditor. This will allow you to set the Tooltip in an MVVM friendly way in XAML by just using binding and a Converter to display the values in the correct format. Please note that the DataContext of the Tooltip should be set to the PlacementTarget:
<DataTemplate> <ig:XamMultiColumnComboEditor x:Name="XMCCombo" DisplayMemberPath="Label" ItemsSource="{StaticResource data}" SelectedIndex="{Binding Close, Mode=TwoWay}" ToolTipService.ShowOnDisabled="True"> <ig:XamMultiColumnComboEditor.ToolTip> <ToolTip DataContext="{Binding Path=PlacementTarget, RelativeSource={RelativeSource Self}}" Content="{Binding SelectedItems, Converter={StaticResource ItemsToTextConverter}}"/> </ig:XamMultiColumnComboEditor.ToolTip> </ig:XamMultiColumnComboEditor> </DataTemplate>
Let me know if you need further assistance.
Hi Maria,Thanks for the solution. Can explain: DataContext of the Tooltip should be set to the PlacementTarget, for my better understanding?and also provide an example code for the ItemsToTextConverter.
Hello Piyush,
The tooltip does not have access to the XamMultiColumnComboEditor unless its DataContext is set using a RelativeSource binding and Path set to PlacementTarget:
<ToolTip DataContext="{Binding Path=PlacementTarget, RelativeSource={RelativeSource Self}}"
Please find below an implementation for the Converter which converts the XamMultiColumnComboEditor.SelectedItems to string which is displayed in the tooltip.
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { string tooltipText = ""; ObservableCollection if (collection != null && collection.Count > 0) { foreach (Data item in collection) { tooltipText = tooltipText + " " + item.Label.ToString(); } } return tooltipText; }
{
string tooltipText = "";
ObservableCollection
if (collection != null && collection.Count > 0)
foreach (Data item in collection)
tooltipText = tooltipText + " " + item.Label.ToString();
}
return tooltipText;
I am attaching a modified version of the project which includes the changes above.
Please feel free to let me know if you have any questions.
We have to disable particular row from the XamMultiColumnComboEditor control dropdown. I was able to disable it by adding following changes I found from following link 'http://www.infragistics.com/community/forums/t/86513.aspx'
<Style xmlns:igPrim="http://schemas.infragistics.com/xaml/primitives" TargetType="{x:Type igPrim:ComboCellsPanel}"> <Setter Property="IsEnabled" Value="{Binding IsActive}"/></Style>
But, if I use Ctrl+Enter the disabled row is also getting selected. What can be done to avoid selection of disabled item using keyboard?