When biding IsVisible of column in RadMultiColumnComboBox/GridViewItemsSourceProvider using MVVM pattern, the binding won't work initially, but is works as expected if removing the ElementName and adding it back in the below example xaml using debugger.
PS1. The binding for CheckBox(in the below sample) works with issue but not for RadMultiColumnComboBox
PS2. Also attached full sample code.
<Window x:Class="TestProject.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:local="clr-namespace:TestProject"
Title="MainWindow" Height="350" Width="525">
<Grid Margin="0,0,0,20" x:Name="rootGrid">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Button Grid.Row="0" Command="{Binding ToggleCmd}">Toggle Last Name Visible</Button>
<CheckBox Grid.Row="1" IsChecked="{Binding IsLastNameVisible}">Is Last Name Visible</CheckBox>
<telerik:RadMultiColumnComboBox Grid.Row="2">
<telerik:RadMultiColumnComboBox.ItemsSourceProvider>
<telerik:GridViewItemsSourceProvider ItemsSource="{Binding AllClubs}" AutoGenerateColumns="false" >
<telerik:GridViewItemsSourceProvider.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding FirstName}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding LastName}"
IsVisible="{Binding DataContext.IsLastNameVisible , ElementName=rootGrid}" />
</telerik:GridViewItemsSourceProvider.Columns>
</telerik:GridViewItemsSourceProvider>
</telerik:RadMultiColumnComboBox.ItemsSourceProvider>
</telerik:RadMultiColumnComboBox>
</Grid>
</Window>
Hi Telerik-Team,
i found a bug similar to forum post, but not the same.
In MultiColumnComboBox when SelectionBoxesVisibility is set to 'collapsed' and and whatever you set AutoCompleteMode to (different from the forum post),
if you select the first item it is not shown. Although the NullText is removed. It works perfectly for all the other items. This is quiet a problem if you only have one item in the dropwdown :D
Regards,
Mats
The cell highlighting doesn't work if the ItemsSourceProvider.ItemsSource is set at runtime, while the drop down is open. The filtering of the items works, but the cell content is not colored.
To work this around, make sure to set the ItemsSource before the drop down gets opened.
NotImplementedException is thrown if the ItemsSourceProvider property is set in a Style setter.
To work this around, implement custom GridViewItemsSourceProvider and override its CreateInstanceCore method.
public class CustomGridViewItemsSourceProvider : GridViewItemsSourceProvider
{
protected override Freezable CreateInstanceCore()
{
return new CustomGridViewItemsSourceProvider();
}
}
If you set the KeepDropDownOpen property of RadMultiColumnComboBox to False, clicking outside of the control should close the popup showing the dropdown content. This stops working after you drag a row from the GridView outside of the dropdown. For example, the drop can happen outside of the RadMultiColumnComboBox control or on its text input and drop down button area.
To resolve this, you can subscribe to the PreviewMouseLeftButtonUp event of RadMultiColumnComboBox and capture the mouse when needed.
this.mccb.AddHandler(RadMultiColumnComboBox.PreviewMouseLeftButtonUpEvent, new MouseButtonEventHandler(Mccb_MouseLeftButtonUp), true);
//---------------
private void Mccb_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
var button = Mouse.DirectlyOver as RadDropDownButton;
if (this.mccb.IsDropDownOpen && button != null && button.TemplatedParent is RadMultiColumnComboBox)
{
Dispatcher.BeginInvoke(new Action(() => { button.CaptureMouse(); }));
}
}
The value of the SelectedItem is shown twice when the theme is changed.
A temporary solution to this would be to revert to the 2022.2.511 version.
The text of the text input box is automatically assigned if SelectedItem is set initially. This should happen when the SelectionBoxesVisibility property is set to Visible (which is the default value). For example, if you have an item called "Item A" and you assign it to the SelectedItem property at startup of the control, then the text will also become "Item A".
To work this around, you can manually clear the text on loaded of the control.
private void RadMultiColumnComboBox_Loaded(object sender, RoutedEventArgs e)
{
var mccb = (RadMultiColumnComboBox)sender;
var tb = mccb.FindChildByType<TextBox>();
tb.Text = string.Empty;
}
private void RadMultiColumnComboBox_Loaded(object sender, RoutedEventArgs e)
{
var mccb = (RadMultiColumnComboBox)sender;
var selection = mccb.SelectedItem;
mccb.SetCurrentValue(RadMultiColumnComboBox.SelectedItemProperty, null);
mccb.SetCurrentValue(RadMultiColumnComboBox.SelectedItemProperty, selection);
}