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
Hello Piyush,
The XamGrid alternate rows could be controlled using the XamGrid.IsAlternateRowsEnabled property. It should be true for the alternate style to appear.
DisplayMemberPath could be set to a single property of your data source. If you would like a complex data to be displayed, you can define such property combining multiple items and then set the DisplayMemberPath to that property.
The CellControl has an MouseEnter event as well. You can add a style for the CellControl and add an EventHandler for the MouseEnter event. Then, using the visual tree the XamMultiColumnComboEditor and its selected items can be accessed.
The lines between rows and columns could be removed by setting CellControl’s BorderThickness property to 0.
The row style could also be controlled using a CellControl style and DataTrigger as it is suggested in the following forum thread: http://www.infragistics.com/community/forums/t/92359.aspx.
Let me know if you need additional assistance.
Hi Maria,Thanks for your help on this. It was quite self explanatory. I was successfully able to solve 4,5 pt. with the same approach yesterday.Pt 1. The XamGrid alternate rows could be controlled using the XamGrid.IsAlternateRowsEnabled property. It should be true for the alternate style to appear. -- I want to control the AlternateRowEnabled for the XamMultiColumnComboEditor. Can you answer the same.Pt 3. The CellControl has an MouseEnter event as well. You can add a style for the CellControl and add an EventHandler for the MouseEnter event. Then, using the visual tree the XamMultiColumnComboEditor and its selected items can be accessed.
-- Can you please help with some other post link or a sample project with this type of function i.e. using visual tree and getting selected Items of the XamMultiColumnComboEditor into the Cellcontrol of Xamgrid when XamMultiColumnComboEditor is disabled.Also, I would love to have suggestion for:Disable Editing, Deleting selected data items, manipulating them, filtering and also text trimming in the SpecializedTextBox. I tried by just making it readonly but still not getting desired results.Please let me know, the properties apart from Read-Only to be setup in the Style for SpecializedTextBox.
Can I expect an answer as early as possible, as I stuck in with a very important part.Thank You!
Also, Maria can you help me with adding ellipsis in the specialized textbox once the number of items selected exceeds the box.
Hello Piyush,The PreviewKeyDown event could be handled when a Control key is down so the items in the drop down does not get focused:
private void XMCCombo_PreviewKeyDown(object sender, KeyEventArgs e) { if ((Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))) { e.Handled = true; } }
The closing of the drop down when an item is clicked could be canceled in the DropDownPopulating event:
private void XMCCombo_DropDownClosing(object sender, CancelEventArgs e) { e.Cancel = true; }
You can modify the default template for the XamMultiColumnComboEditor located in the generic.xaml file at C:\Program Files (x86)\Infragistics\2016.2\WPF\DefaultStyles\XamComboEditor to display the ellipsis around the SpecializedTextBox.
Is there any way to do it through code?? - Handling ellpises for SpecializedTextBox.Actually I want to have ellipses in XamMultiColumnComboEditor
Hello Piyush,The Ellipse could be added in code behind by going through the visual tree to find the SpecializedTextBox element and add the ellipse to its parent’s children. If you would like to do this when an item is selected it will look similar the code below:
private void XMCCombo_SelectionChanged(object sender, Infragistics.Controls.Editors.SelectionChangedEventArgs e) { if (e.AddedItems.Count >0) { SpecializedTextBox stBox = Utilities.GetDescendantFromType(sender as DependencyObject, typeof(SpecializedTextBox), false) as SpecializedTextBox; if (stBox != null && (stBox.Parent as Grid) != null) { Ellipse el = new Ellipse(); el.Stroke = new SolidColorBrush(Colors.Red); (stBox.Parent as Grid).Children.Add(el); } } }
You can also modify the code above to apply the changes based on some custom logic instead of just checking whether there is an item in the AddedItems collection.